Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
boris_nechaev
Contributor III
Contributor III

Reversed straight table.

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.

1 Solution

Accepted Solutions
boris_nechaev
Contributor III
Contributor III
Author

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!

View solution in original post

4 Replies
swuehl
MVP
MVP

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

boris_nechaev
Contributor III
Contributor III
Author

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?

swuehl
MVP
MVP

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)

boris_nechaev
Contributor III
Contributor III
Author

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!