Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
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]

Labels (1)
13 Replies
sunny_talwar
MVP
MVP

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
MVP
MVP

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
MVP
MVP

No problem at all