Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
liam_hanninen
Contributor

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

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

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
Contributor

Re: Translating to set analysis

Yes great, thanks. And thanks for the link.

MVP
MVP

Re: Translating to set analysis

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