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

Rolling date range in set analysis expression

I am trying to create a set analysis expression that will select transactions that have date from today to three days ago. This is the expressionL

(Sum ({<nDate = {"$((>=num(today())-1))"}>}[Actual Input Qty]))-(Sum ({<nDate = {"$((>=num(today())-1))"}>}[Std Input Qty])) 

This expression returns zero for all instances.  I would appreciate any help you can provide.

1 Solution

Accepted Solutions
Not applicable
Author

I ended up using the following after creating YearDay using the DayNumberOfYear expression in the load script:

= sum({<"YearDay" = {">=$(=max(YearDay)-4)<=$(=max(YearDay))"}>}[Actual Input Qty] - [Std Input Qty])

Thanks to those who responded.

View solution in original post

3 Replies
Not applicable
Author

Hi,

Try to get Day from NDate then using this expression:

sum({<Day= {">=$(=max(Day)-3)<=$(=max(Day))"} >} [Actual Input Qty]-[Std Input Qty])

Hope its can help you.

- Heri

MayilVahanan

Hi

  Try this,

   = sum({<nDate = {">= $( = max (nDate) - 3) <= $(= max(nDate) )"}>}[Actual Input Qty] - [Std Input Qty])

hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

I ended up using the following after creating YearDay using the DayNumberOfYear expression in the load script:

= sum({<"YearDay" = {">=$(=max(YearDay)-4)<=$(=max(YearDay))"}>}[Actual Input Qty] - [Std Input Qty])

Thanks to those who responded.