5 Replies Latest reply: Sep 26, 2012 11:22 AM by Mike Dales

# 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.

Mike

• ###### Re: 2 counts in one expression - set analysis?

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])

• ###### Re: 2 counts in one expression - set analysis?

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

• ###### Re: 2 counts in one expression - set analysis?

Add the quotes also:

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

• ###### Re: 2 counts in one expression - set analysis?

Whiteline

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

Mike

• ###### Re: 2 counts in one expression - set analysis?

Whiteline

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

Mike