Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Marcel_Garcia
Contributor II
Contributor II

Display latest 5 weeks in straight table

Hi all,

I'm trying to display only the latest 5 weeks on a straight table but when I use the 'Fixed number' top 5 It give me a result based on the next column measurement.
Marcel_Garcia_2-1597911139662.png

My goal is to show the latest top 5 weeks (the most recent ones every week) independently of the measurements.
but if a try max(my_date) or similares it says invalid dimension.
Any idea of how to sort this out?
Thanks.

Labels (4)
1 Solution

Accepted Solutions
eliran
Creator III
Creator III

Hi,

 

The easy approach, is using if statement in the dimension itself, thus having all the "right" dates for you.

It's an approach I don't really like, and it's one that should bv avoided usually, but maybe it's suited for your scenario.

The second approach, is inserting a set analsys or if inside all the measures.

Let's assume vLast5Weeks is a variable that holds =today()-35

sum({<Date={'>=$(vLast5Weeks)'}>}Sales) / sum(if(Date>=$(vLast5Weeks),Sales))

 

Hope it helps,

Eliran.

View solution in original post

1 Reply
eliran
Creator III
Creator III

Hi,

 

The easy approach, is using if statement in the dimension itself, thus having all the "right" dates for you.

It's an approach I don't really like, and it's one that should bv avoided usually, but maybe it's suited for your scenario.

The second approach, is inserting a set analsys or if inside all the measures.

Let's assume vLast5Weeks is a variable that holds =today()-35

sum({<Date={'>=$(vLast5Weeks)'}>}Sales) / sum(if(Date>=$(vLast5Weeks),Sales))

 

Hope it helps,

Eliran.

View solution in original post