Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I have a horizontal straight table with date as dimension. The task is to show 7 latest days. The solution is simple: sort the date in descending order and set 'Max number' in 'Presentation' tab to 7. This shows 7 days decreasing from left to right.
The problem is that a client repeatedly asks to show the newest date to the right, not left. How can I do this? If it would be a bar chart, I could have selected 'Reversed' option in 'Presentation' tab, but alas there is no such option for straight table.
If it's not possible to do this with the table settings, perhaps someone could suggest an expression for the calculated dimension that will do the job.
Stefan, in fact, I read your replies in this post: http://community.qlik.com/thread/34993?start=15&tstart=0 and they pushed me in the right direction.
This is the calculated dimension that seems to do the job:
=if(Date <= max(total Date) and Date > max(total Date)-7, Date)
Thanks a lot for you help!
To show the dates of last week only, you could use a calulated dimension, like
=if(Date <= today() and Date > today()-7,Date)
Alternatively, use a set expression in your expression(s), e.g.
=count({<Date = {">$(=date(today()-7))<=$(=today())"}>} Customer)
Hope this helps,
Stefan
Thanks, Stefan.
This does the trick partially. Though it won't work if I select e.g. a month in the month(Date) list box. In this case I need a calculated dimension that is relative not to today(), but to the maximum selected date. Any idea how to write such a calculated dimension?
Try a set expression in your expressions, e.g. create a table with dimension Date and expression
=count({<Date = {">$(=Date(max(Date)-7))<=$(=Date(max(Date)))"}, Month=,Year= >} Date)
Stefan, in fact, I read your replies in this post: http://community.qlik.com/thread/34993?start=15&tstart=0 and they pushed me in the right direction.
This is the calculated dimension that seems to do the job:
=if(Date <= max(total Date) and Date > max(total Date)-7, Date)
Thanks a lot for you help!