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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
jonathandienst
Partner - Champion III
Partner - Champion III

Compound Set Analysis AND Comparison

Hi

I am trying to convert this expression (from a table containing StartDate and DealCode) to set analysis and I have hit a snag

This is the IF expression which works correctly

Count(If((StartDate >= '2010/07/01') AND (StartDate <= '2010/07/31'), DealCode))

After a some attempts, I got this:

Count({<StartDate={'>=2010/07/01','<=2010/07/31'}>} DealCode)

But, the problem is that it seems to be combining the comparisons by ORing them, which means that the entire date range is being included. I need them to be ANDed, to produce only dates within the range.

This happens whether the date comparisons are separated, or combined like '>=2010/07/01,<=2010/07/31', or even if I put 2 StartDate={} expressions in the set.

What am I missing here?

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
1 Solution

Accepted Solutions
mike_garcia
Specialist
Specialist

Hello,

Use this:

Count({<StartDate= {">=2010/07/01<=2010/07/31"}>} DealCode)


Double quotes indicate search string. You may need to adjust the date format to match the data exactly as it is stored. Sometimes I use the number representation to avoid confusion.

Regards,

Mike.

Miguel García
Qlik Expert, Author and Trainer

View solution in original post

4 Replies
mike_garcia
Specialist
Specialist

Hello,

Use this:

Count({<StartDate= {">=2010/07/01<=2010/07/31"}>} DealCode)


Double quotes indicate search string. You may need to adjust the date format to match the data exactly as it is stored. Sometimes I use the number representation to avoid confusion.

Regards,

Mike.

Miguel García
Qlik Expert, Author and Trainer
martin59
Specialist II
Specialist II

Hi Jonathan,

You have to try this :

Count({<StartDate={">=2010/07/01 <=2010/07/31"}>} DealCode)


markmccoid
Partner - Creator II
Partner - Creator II

You pretty much have it just change it to the below:

Count({<StartDate={'>=2010/07/01<=2010/07/31'}>} DealCode)

Hope this helps.

jonathandienst
Partner - Champion III
Partner - Champion III
Author

Duh!

Thanks Martin and Mike - I forgot that " means search string. I tried virtually every combination I could think of except that one.

BTW - it works correctly with or without the spaces.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein