Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Set

Please find the attachment

I have created a new field form the existing data base

On the dashboard you can see that ther are many text object in which i have used set analysis

Which keeps changing when i make a selections on  DRUGRESULT  and gives the exact data.

But i want the text object to display the value according the selection of the listbox DRGRSLT.

Thanks Sunny

Your exprssion works for all the chart single and as well as multiple selection ,

But the main text object which has count( distinct PTNUMBER ) is not giving thr appropriate result .

14 Replies
swuehl
MVP
MVP

Sorry, I think we still miss what you are trying to do.

In your expressions

=count(DISTINCT {$<DRGRSLT={'Sensitivity'} >}PTNUMBER)


you modify field DRGRSLT, not DRUGRESULT, that's why user selections in DRGRSLT won't change the expression result. And user selections in DRUGRESULT only have an effect if they are compatible /possible with the set modifier for DRGRSLT (edit: otherwise the expression return zero).

smilingjohn
Specialist
Specialist
Author

Hi Kaushik

This works with single selection but when i select multiple values in DRGRSLT  its not working .

That is if i slelect Sensitivity , Resistant and Intermediate , then the values in all the text object becomes 0

sunny_talwar

Try this in case of multiple selections:

If(SubStringCount(Concat(DISTINCT DRGRSLT, '|'), 'Sensitivity') = 1,  Count(DISTINCT {$<DRGRSLT={'Sensitivity'}>}PTNUMBER),0)

smilingjohn
Specialist
Specialist
Author

Thanks Sunny this is working on all the text object , But now the main text object which has the expression

Coount( Disticnt Ptnumber) is not giving the corrcte result

Foir example when only one selection is made say for example Resisitant is selected and thge count is 122

then the Count( Disticnt Ptnumber ) = 122

and when multiple selection are made for example i select Resistant and Intermediate which is 122 and 10

then the Count( Disticnt Ptnumber ) should be 132 , which is not showing and it is showing as 122 only

sunny_talwar

Try this expression for the main text object may be:

=Sum(Aggr(Count(DISTINCT PTNUMBER), DRGRSLT))