Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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

How to Write a Date Range in Using Set Analysis

Hello All,

I have a If Statement like this:

Count(If(Type = 'XXX' and Create_Date>=Date(Today()-14) and Create_Date < Date(Today()-7),ID) )

and i would like to re-write the same using Set Analysis..How can we write it..i tried writing this way but somehow no luck.

In Data Load Editor:

LET Vtoday14=Today()-14;

LET Vtoday7=Today()-7;


In the Expression:

Count({< Type = {'XXX'},Create_Date={">=$(Vtoday14)"} ,Create_Date={"<$(Vtoday7)"}) >} ID)

Any help will be appreciated.

Regards,

PK

5 Replies

Re: How to Write a Date Range in Using Set Analysis

May be this

Count({<Type = {'XXX'},Create_Date={">=$(=Vtoday14)<$(=Vtoday7)"}>} ID)

praveen1108
Contributor

Re: How to Write a Date Range in Using Set Analysis

This gives me a a different result lets say X where as my If gives me Y.

Re: How to Write a Date Range in Using Set Analysis

What? No idea what the means?

praveen1108
Contributor

Re: How to Write a Date Range in Using Set Analysis

Hello Sunny,

The one you suggested is working but not giving me the correct result.

Re: How to Write a Date Range in Using Set Analysis

May be share a sample?