Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
liam_hanninen
Not applicable

Translating to set analysis

If I want to only see sales from Canada I would do this in set analysis:

sum({<Country={'Canada'}>} Sales)

similarly (but not ideally) I could do;

if (Country='Canada', Sales)

Now if I only want to see sales from this last year (YTD) I might do:

if( min(%Date)>(today()-365), Sales)

What is the set analysis equivalent of this?

1 Solution

Accepted Solutions
sunny_talwar
Not applicable

Re: Translating to set analysis

May be something like this:

Sum({<%Date={"$(='>=' & Date(Today() - 365, 'DateFieldFormatHere'))"}>} Sales)

Also look here:

Dates in Set Analysis

3 Replies
sunny_talwar
Not applicable

Re: Translating to set analysis

May be something like this:

Sum({<%Date={"$(='>=' & Date(Today() - 365, 'DateFieldFormatHere'))"}>} Sales)

Also look here:

Dates in Set Analysis

liam_hanninen
Not applicable

Re: Translating to set analysis

Yes great, thanks. And thanks for the link.

maxgro
Not applicable

Re: Translating to set analysis

sum({$ <Date={">=$(=AddYears(Today(),-1))<=$(=Today())"}>} Sales)