Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
TooncesTheCat
Contributor
Contributor

Count field using Set Analysis for two separate fields

Hi everyone, I've become lurker on this forum over the last few months, but I'm really stuck right now on this question:

I have a Table where I'd like to display the Count for Field "IC" where "Training" is 'Incomplete' but exclude records where the trainee is within one year of joining the organization. I scripted a field where the date is one year after joining "EOD1".

=Count(IC) gives me the basic count

=Count({$<[Training]*={'Incomplete'}>}IC) Gives me the count where "Training" is 'Incomplete'

Count({$<EOD1={">$(=Today(1))"}>}IC) Should give me the count where "EOD1" is less than Today(1), but I think this is where I'm going wrong.

Then, I'd like to join these sets for a working expression in the table, like this:

=Count({$<[Training]={'Incomplete'},EOD1-={">=$(=Today(1))"}>}IC)

FYI: My Date Format is D/M/YYYY

Thank you!

Labels (2)
2 Solutions

Accepted Solutions
Miguel_Angel_Baeyens

Make sure the format of EOD1 D/M/YYYY is as well the one returned by $(=Today(1)).

In your second expression you are using the set operator "*=". Is it a typo or you are really want to intersect the values in the data with those from your selections?

View solution in original post

TooncesTheCat
Contributor
Contributor
Author

Thank you Miguel,

Yes, that's a typo. I was experimenting with the set expression generator, and realize that intersection is not what I wanted. Instead I want to select rows in "IC" where both the field values in "Training "are "Incomplete" and "EOD1" are "'Less than or Equal to' Today"  where the conditions are as outlined are true, not the intersection of those selections.

You're correct about the Date too, I think that contributed to the Date expressions not working earlier. 

I think I have it.  For the date element, I have: [EOD1]= {"<=$(=Date(Today(), 'M/D/YYYY'))"}

So for the complete set expression: 

Count({<[Training]={'Incomplete'},[EOD1]= {"<=$(=Date(Today(), 'M/D/YYYY'))"}>} IC))

Thank you very much!

View solution in original post

2 Replies
Miguel_Angel_Baeyens

Make sure the format of EOD1 D/M/YYYY is as well the one returned by $(=Today(1)).

In your second expression you are using the set operator "*=". Is it a typo or you are really want to intersect the values in the data with those from your selections?
TooncesTheCat
Contributor
Contributor
Author

Thank you Miguel,

Yes, that's a typo. I was experimenting with the set expression generator, and realize that intersection is not what I wanted. Instead I want to select rows in "IC" where both the field values in "Training "are "Incomplete" and "EOD1" are "'Less than or Equal to' Today"  where the conditions are as outlined are true, not the intersection of those selections.

You're correct about the Date too, I think that contributed to the Date expressions not working earlier. 

I think I have it.  For the date element, I have: [EOD1]= {"<=$(=Date(Today(), 'M/D/YYYY'))"}

So for the complete set expression: 

Count({<[Training]={'Incomplete'},[EOD1]= {"<=$(=Date(Today(), 'M/D/YYYY'))"}>} IC))

Thank you very much!