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: 
Anonymous
Not applicable

Count on Set analysis expression with dates as if condition

Find the below table as sample:

Capture 2.PNG

I have this set analysis expression " Count({<MachDatekey = {"=design_accept = 3"}>} DISTINCT MachDatekey) "to count distinct MachdateKey if design_accept=3 for all rows of that MachDateKey.

Now I have included Date field in the input data as I have another version of data for the same MachDateKey.

How can I include the Datefield in the above set analysis expression for getting the same result by considering 8/7/2018 as minimum date and 8/14/2018 as maximum date ?

4 Replies
michaelsikora
Contributor III
Contributor III

May be try this:

Count(DISTINCT {<MachDatekey = {"=design_accept = 3"}, DateField ={">=$(=today()-7)) <=$(=today()-1))"}

>}  MachDatekey)


If you want you can replace today()-7 with a specific date '8/7/2018' depending on your format for date.

jonathandienst
Partner - Champion III
Partner - Champion III

Doesn't the simple expressions work?

Count({<design_accept = {3}>} DISTINCT MachDatekey)

Use this in a table/chart with Date as a dimension.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

I can't because that will become the third dimension.

Anonymous
Not applicable
Author

I got the expression.

Thanks all