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: 
Not applicable

2 counts in one expression - set analysis?

Hello,

I am looking to use set analysis to count people waiting over 52 weeks from my latest run of data and show this in a text box.

I have got this far

=Max({<Run_Number = {$(=Max(Run_Number))}>}[PTL Weeks Waited])

This gets the maximum run number

=count({<[Breach graph wait band]={'52 +'}>}[Breach graph wait band])

This gets people over 52 weeks

I am looking for a way of putting these two expressions into one to only bring back all patients over 52 weeks for the latest run month only.

I have tried

=count({<Run_Number = {$(=Max(Run_Number))}>}{<[Breach graph wait band]={'52 +'}>}[Breach graph wait band])

This counts all patients over 52 weeks but ignores the run number!

This is my first post and any help would be greatly appreciated.

Thanks in advance

Mike

1 Solution

Accepted Solutions
whiteline
Master II
Master II

Add the quotes also:

=count({<Run_Number = {'$(=Max(Run_Number))'}, [Breach graph wait band]={'52 +'}>}[Breach graph wait band])

View solution in original post

5 Replies
whiteline
Master II
Master II

Hi.

You use two sets instead of one, try this:

=count({<Run_Number = {$(=Max(Run_Number))},>}{<[Breach graph wait band]={'52 +'}>}[Breach graph wait band])

Not applicable
Author

Hey whiteline Thanks for replying so quickly,

Unfortunately this shows no data and I know there were 7 people over 52 weeks.

=count({<Run_Number = {$(=Max(Run_Number))},>}{<[Breach graph wait band]={'52 +'}>}[Breach graph wait band])

It doesnt seem to like the first comma, However if I remove the comma it continues to ignore the run number.

Thanks for looking at this for me its my first day using Qlik View and its turning out to be a long one!

MIke

whiteline
Master II
Master II

Add the quotes also:

=count({<Run_Number = {'$(=Max(Run_Number))'}, [Breach graph wait band]={'52 +'}>}[Breach graph wait band])

Not applicable
Author

Whiteline

That worked perfectly.  Thank you so much for your help today, very much appreciated.

Mike

Not applicable
Author

Whiteline

That worked perfectly.  Thank you so much for your help today, very much appreciated.

Mike