Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show data in graph for last 4 weeks

Hey people!

Could somebody please help me. In bar chart i need to show data for last 4 weeks. And because is start of a year 2015, qlikview shows me data just for weeks 2 and 1 (if starting from today). How can I get data also for weeks 52, 51 and 1 in december 2014?  So weeks 52, 51, 1, 2 in the same graph? Until now i used variable for week something like that:

Last4Weeks = '>' & (max(Week(Today())-1) - 4) & '<=' & max(Week(Today())-1) and then I used it in a graph in set analysis:

Week = {'$(Last4Weeks)'}. But now is not working anymore properly and shows me just weeks 1 and 2.

Hope I explained well and really hope somebody can help me.

PS: I need something like this also to show data for last 6 months.

Thanks and regards,

Anja

1 Solution

Accepted Solutions
saurabh5
Creator II
Creator II

Hi Anja,

Try something like below if it works for your scenario:

=Count({<[Date]={">=$(=date(max(Today())-28,'M/D/YYYY'))<=$(=Date(Max(Today())-1,'M/D/YYYY'))"} >}DISTINCT [What ever id u have])


View solution in original post

4 Replies
aadil_madarveet
Partner - Creator II
Partner - Creator II

Hi,

What is the dimension you are using for this chart.

Is there any restriction you have put in dimension also.

saurabh5
Creator II
Creator II

Hi Anja,

Try something like below if it works for your scenario:

=Count({<[Date]={">=$(=date(max(Today())-28,'M/D/YYYY'))<=$(=Date(Max(Today())-1,'M/D/YYYY'))"} >}DISTINCT [What ever id u have])


Not applicable
Author

Hi Saurabh,

It's working Except that i put this formula in variable

Thank you very much

Regards,

Anja

Not applicable
Author

Hi Aadil,

My dimensions are Week (from master calendar) and dimension for which i want data to display. I have no restriction in dimensions.