I'm relatively new at Qlikview and wanted to compare some data from a selected year with its previous year.
In Qlikview I have a table in which i show the count of all the contacts there have been with the customer per mount [=count(contactsID)] with the dimension [contacts.month]
I want to show an other expression with the contacts with customers in the same month a year before.
So if my table shows all the contacts from jan-2014 until dec-2014 I want a bar next to every month with the months jan-2013 until dec-2013
for example jan-2013/jan-2014; feb-2013/feb-2014; etc
some extra information:
In the database is a date saved. In Qlikview i load that as:
load
date as contact.date,
Year(date) as contact.year,
Month(date) as contact.month,
Day(date) as contact.day;
If anybody could help i would be very grateful! Thanks to all of you in advance!
I got the answer on the Qlikview community!
Add expression as:
count({<contact.year={$(=contact.year-1)}>}ContactID)
http://community.qlik.com/message/517136#517136
You can solve this problem at the script side while loading data. So that you can compare year to date data with previous year with until corresponding month.
Transaction_Table:
LOAD date,productID,amount
FROM data.qvd;
concatenate
Load AddYears(date,1) as date,productID,amount_1
Resident data where date<=AddYears($(=max(date)),-1);
There will be two coloumns "amount" is current date's data and "amount_1" is previous year's same day data.
Related
i have a field for date with date, month and year.In my visualization, I need date to be displayed in (MON-Year) format.
I switched to data view, created calculated column with
Mon-Year = FORMAT('table'[Date],"YYYY-MM")
Now it's getting displayed as (YEAR and Month number) but I want to change it as month name.
After changes in data view, when I close apply, the column is present but there is no data type visible.
Should I create different calculated fields for year and month separately and then concatenate it?
any help would be appreciated.
If you want month first, then maybe you should specify it that way.
Mon-Year = FORMAT('table'[Date],"MMM-YYYY")
This may be useful for you:
https://learn.microsoft.com/en-us/dax/custom-date-and-time-formats-for-the-format-function
In the data underlying my dashboard each row is a type of encounter, in the table I have rows as facility and columns show number of records by month. The issue I'm having is that the month columns stop where the data stops; for example in one facility the last encounter was in September, when the user looks at it the table stops at September, I need the table to show 0's up to the current month with each month in between (though not in the data) shown.
If anyone has any ideas it would be greatly appreciated!
I have 3 tables, one with stocktakes conducted last year, one with stocktakes conducted this year and one with sales. All of them are joined by date to one table where I have dates.
Now the question is what can I do to get table with:
store name/ last year stocktake date/ this year stocktake date/ sum of sales from last year stocktake date to this year stocktake date.
If you choose store, than stocktake date from one table, stocktake from second table all looks good, the problem is that I can't get sales to show from/to.
C2Csales = calculate(sum(PP_SalesLessTax[SalesLessTax]),PP_SalesLessTax[date] >= [ly date])
[ly date] is just a measure with last year stocktake date
I have a feeling that this have to be very easy but have no idea how to get this work
thanks
daniel
please see data model. It is a part of bigger model but I have trimmed it so it is clear what is this about.
data model
And here is what I need. Please see picture.
thanks for all responses
result required
You don't need two tables to simulate years. You can have just one. The idea of last year should be calculated by a measure. If you have a complete date table with a day for each row without missing days then you can build time intelligence.
If I get you, you need something like this two measures:
Sales = sum(PP_SalesLessTax[SalesLessTax]
Sales LY = CALCULATE ( sum(PP_SalesLessTax[SalesLessTax] , SAMEPERIODLASTYEAR ( DatesTable[DateColumn] )
With this two measures you can take both of them on same visualizations to compare them.
The idea of having from and to can be solved on visualizations. The slicer with a date type column can create a range filter data that will apply for this two created measures.
I am fetching a stored procedure to the report having two columns as date and non business day. I need to create a year wise calendar for the year which is getting fetched from stored procedure. Each page will have a calendar of a year with 12 months along with days.
Well, you would need a dataset with a Date (Day and Year at least) and a corresponding value for this Day. Then simply add a matrix in your report. For the columns textbox chose the Date (Day) and for the rows textbox chose the Date (Year). In the data textbox use your value. If you load it, it will look like calender because the Days get brocke down by Year.
In my application I have to store data month wise and year wise. So for this, I have to store the data along with date into database.
My requirement is how to store in terms of date and how to retrieve data with group by month and year. In my app I am showing a table of years and months, based on selected month and year. I have to show the data in a dashboard.
My problem is in storing and retrieving date data types.
Use the following syntax
SELECT * FROM DATABASE WHERE REQUIREDDATEFIELD LIKE '%2011-01%';
2011 is supposed to be the year
01 is supposed to be the month
DATABASE is supposed to be your mysql database name
REQUIREDDATEFIELD is supposed to be the field you are hoping to sort from month and year.
like '%2011-01%' is supposed to be meaning, all the records containing 2011-01 in the given field. It could be in the beginning or the end or in the middle of a large text, so having % in both the beginning and end of the search criteria is a good habit.
You just select either for a specific month or year or month and year. Or if you want all, you use GROUP BY.
I know this answer is quite vague and generic, but that's because your question is vague. You probably need to be more specific. Explain not only what you want to do, but what you have tried, and in which way that didn't work.