Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Show previous dates data in same row as date selected

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

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Show previous dates data in same row as date selected

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.


talk is cheap, supply exceeds demand
9 Replies
MVP & Luminary
MVP & Luminary

Re: Show previous dates data in same row as date selected

You can probably use the above() function to get the previous dates sales figure: above(sales figure)


talk is cheap, supply exceeds demand
vikasgupta
Contributor

Re: Show previous dates data in same row as date selected

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

Not applicable

Re: Show previous dates data in same row as date selected

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

MVP & Luminary
MVP & Luminary

Re: Show previous dates data in same row as date selected

Try this then:

=sum({<Date={"=$(=max({<Date={'<$(=max(Date))'}>} Date))"}>} [sales figure])


talk is cheap, supply exceeds demand
Not applicable

Re: Show previous dates data in same row as date selected

Hi

Thats not working either - though looks like too many brackets.

I have tried it with all different date formats too.

Ta Jo

Not applicable

Re: Show previous dates data in same row as date selected

I have tried the below to populate the table - Only one date can be selected by the user

//sum({<DateVal={"=$(=max({<DateVal={'<$(=max(DateVal))'}>} DateVal))"}>} SalesRetailGross])

//sum({<DateText={"=$(=max({<DateText={'<$(=max(DateText))'}>} DateText))"}>} SalesRetailGross])

sum({<DateId={"=$(=max({<DateId={'<$(=max(DateId))'}>} DateId))"}>} SalesRetailGross])

DateVal DateText Sales2012-09-19Previous Date
19/09/2012 00:00:002012-09-19£1145448.020

Not sure how to attached the QV to this  discussion

Many Thanks

MVP & Luminary
MVP & Luminary

Re: Show previous dates data in same row as date selected

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.


talk is cheap, supply exceeds demand
Not applicable

Re: Show previous dates data in same row as date selected

Thankyou very much - I shall try this once im back from my xmas break :-)

Not applicable

Re: Show previous dates data in same row as date selected

Hi

Thanks that works great thankyou :-).

Jo

Community Browser