Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am trying to creat a table with one summary row;
Date, sales figure, Previous dates sale figure, Variance.
I am having trouble finding the previous dates sale figure to the one selected by the user on the calender.
Any advice greatly appreciated as I am new to Qlkiview
Ok, it's a bit more tricky than I accounted for. Attached is an example that works. I use a variable to calculate the previous date and use the variable in the expression for the previous sales. Also I use a calculated dimension so only the selected date shows in the table. I hope this helps you solve your challenge. In the expression for the variable you need to make sure that the Date field you use is a real date, not a text string. Otherwise the max function doesn't work.
You can probably use the above() function to get the previous dates sales figure: above(sales figure)
Hi Gysbert
Plz I need your help bcz i did not get any solution for this plz click on following links:-
http://community.qlik.com/thread/68878?tstart=30
thanks
Vikas Gupta
Hi
Thanks for your reply unfortunately this doesnt work.
The calender allows just one date selected therefore only data for the date selected is brought back.
Regards
Jo
Try this then:
=sum({<Date={"=$(=max({<Date={'<$(=max(Date))'}>} Date))"}>} [sales figure])
Hi
Thats not working either - though looks like too many brackets.
I have tried it with all different date formats too.
Ta Jo
I have tried the below to populate the table - Only one date can be selected by the user
DateVal | DateText | Sales2012-09-19 | Previous Date |
---|---|---|---|
19/09/2012 00:00:00 | 2012-09-19 | £1145448.02 | 0 |
Not sure how to attached the QV to this discussion
Many Thanks
Ok, it's a bit more tricky than I accounted for. Attached is an example that works. I use a variable to calculate the previous date and use the variable in the expression for the previous sales. Also I use a calculated dimension so only the selected date shows in the table. I hope this helps you solve your challenge. In the expression for the variable you need to make sure that the Date field you use is a real date, not a text string. Otherwise the max function doesn't work.
Thankyou very much - I shall try this once im back from my xmas break 🙂
Hi
Thanks that works great thankyou :-).
Jo