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

Using Set Analysis for Comparing Charts

Hello together,

i have one question:

I have two Dimensions:

Dimension 1 called Group with the fields A B C

Dimension 2 called SubGroup with the fields a b c

My Application should show 2 diagramms. The first one should contain values of A a and the second one should show values A b.

I need the two diagramms to compare the values. If i select A a the diagramm should show the values of A a and then, if i select A b the first diagramm should stay on the screen and a second one for the values A b should be shown, so that i can compare the both diagramms with different values.

I heard that i can realize this case with the Set Analysis Function but i don't know, how to do it.

Can anyone please help me?

Thanks!

15 Replies
Not applicable
Author

Ah ok.And if i want that the first diagramm should show the current selection i can use {$}

=

Sum({<Group.field={$}, SubGroup.field={$}>}Value.value)  instead of

=

Sum({<Group.field={'A'}, SubGroup.field={'a'}>}Value.value)

and my second diagramm should show the next selection so i will write {$_1}

=If(GetSelectedCount(SubGroup.field) > 0 AND Only(SubGroup.field) <> $_1, 1, 0)  instead of

=If(GetSelectedCount(SubGroup.field) > 0 AND Only(SubGroup.field) <> 'a', 1, 0)



Is this correct?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Use this for current selection

=Sum(Value.value)  -- No need of filtering in any expression

show the next selection:

=sum( {$_1} Value.value)   //But I am not sure above the If try removing this condition

Regards,

Jagan.

Not applicable
Author

Hello Jagan, the second Expression =sum( {$_1} Value.value) doesn't work. My second diagramm is empty.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Click Back button and then check.

Regards,

Jagan.

Not applicable
Author

ok last question.

If i select A a 10 the first diagramm shows 10. This is correct. But now if i select B b 20 and click back both diagramm show the same values. How can i change the expression in the first diagram that this

diagramm shows 10 ? your expression =Sum(Value.value) is not ok in this context.

In my first question you can see the second file SetAnalysis2.qvw

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you always need to show A a 10 in the first chart then use the expression

=only({<Group.field={'A'}, SubGroup.field={'a'}>} Value.value)  It always show 10.  Becuase we are hard coded the values.

But in you chart you have the expression =only({$}Value.value), it always change based on the current selection.

Regards,

Jagan.