Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
roxys373s
Contributor II
Contributor II

Show Last 5 dates

Hello,

Alright so I have a combo bar chart as shown below

roxys373s_0-1658267304842.png

 

I want to show  values for the last 5 dates - for example: 7/15/22, 7/16/22, 7/17/22, 7/18/22, and 7/19/22

I tried using this:

roxys373s_1-1658267390115.png

 

but it seems to just give me the top values in my measure. Is there anything like this that can do it for dimension so that I have the last five days instead? 

Labels (4)
1 Solution

Accepted Solutions
Chandan_Nadve
Contributor II
Contributor II

Hi @roxys373s ,

You need to handle this in the  Measure level. In set analysis you need to filter for last 5 days.

I assume that your amount field is "batchamount".

Sum({<batch_date={">=$(=Date(Date(Now())-4))"}>}batchamount)

Regards

Chandan

 

 

 

 

 

View solution in original post

3 Replies
Chandan_Nadve
Contributor II
Contributor II

Hi @roxys373s ,

You need to handle this in the  Measure level. In set analysis you need to filter for last 5 days.

I assume that your amount field is "batchamount".

Sum({<batch_date={">=$(=Date(Date(Now())-4))"}>}batchamount)

Regards

Chandan

 

 

 

 

 

sidhiq91
Specialist II
Specialist II

@roxys373s  Please use below expression in your measure.

Sum({<OrderDate={">=$(=Date(Max(OrderDate)-4))<=$(=Date(Max(OrderDate)))"}>}LineSalesAmount)

You can replace Orderdate and LineSalesAmount as per your Dimensions and Measures

If this resolves your issue, please like and accept it as a solution.

roxys373s
Contributor II
Contributor II
Author

@Chandan_Nadve @sidhiq91 

 

Hello, 

Thank you for the possible solutions, but it still doesn't work. It ends up looking like: 

roxys373s_0-1658321299148.png

 

Since Im filtering for batch_date in my measure, can batch_date still be my dimension? Is that what is causing the issue? Or maybe the expression format is wrong...still trying to search it up