Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic Date in Set Analysis


Hi All,

I trying to get total number of orders completed in last 4 weeks... I am using following expression

Count({$<[Order Status]={'Complete'}, [Product Category]={'Shoes'},[Completion Date]}>}OrderId)

where can I add that last 4 weeks clause in the above set analysis ?

Completion Date field name is [Completion Date]

13 Replies
sunny_talwar

Hi Jyothish -

A lot of the people don't use this syntax, but I like using this because it gives me the flexibility to check my inner portion of the set analysis here. Basically, if you pick this (the portion in red)

[Completion Date] = {"$(='>=' & Date(Max([Completion Date]) - 28, 'DateFieldFormatHere') & '<=' & Date(Max([Completion Date]), 'DateFieldFormatHere'))"}

and paste it in a text box object, you will see the date range needed and in the format needed. If either of the two things don't match, you have to fix it and you can fix that in the text box object. Once fixed, copy the complete expression and paste it between the dollar sign expansion

Alternative to the above being used is this:

[Completion Date] = {">= $(=Date(Max([Completion Date]) - 28, 'DateFieldFormatHere'))<= $(=Date(Max([Completion Date]), 'DateFieldFormatHere'))"}

Which works equally well.

HTH

Best,

Sunny

sunny_talwar

I guess you are right, from his response below (which used today), your script method seems to make sense

jyothish8807
Master II
Master II

Thanks for the explanation

Br,

KC

Best Regards,
KC
sunny_talwar

No problem at all