Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
MPkg
Contributor III
Contributor III

Multiple Alternate states - set analysis for default state chart

Hello,

I have a problem using alternate state in comparison of elements of fields.

I have table:

Groups

Main1

Main2

 

and following tables:

Main1

A_1

B_1

C_1

Sub1A

1

2

3

Sub1B

4

5

6

 

Main2

A_2

B_2

C_2

Sub2A

2

3

4

Sub2B

5

6

7

 

the formula for calculation is:

let vFormula='if(GetSelectedCount(Main1)=1,A_1*2+B_1*3+C_1*4,0)+if(GetSelectedCount(Main2)=1,A_2*2+B_2*3+C_2*4,0)';

I created two Alternate states: As1 and As2 and applied them to two Filter panes:

First filter pane: Groups;

Second filter pane: ="$(=GetFieldSelections([Groups]))";

MPkg_0-1659509053505.png

 

When I use a bar chart to show result of the formula and set alternate state to As1 for the chart, the formula works.

MPkg_1-1659509658637.png       MPkg_3-1659509738620.png

MPkg_4-1659509786379.png

 

When I want to compare two groups, I need to set bar chart to default state, and write formula like this:

MPkg_5-1659509875952.png           MPkg_6-1659509956210.png

But it does not work.

If I create formula like this:

MPkg_8-1659510102828.png

 

MPkg_7-1659510088063.png

It works but the bar chart does not show correct value.

 

If I set formula like this:

MPkg_9-1659510220785.png

It works. But if I set formula like this:

MPkg_10-1659510283338.png

It does not work.

 

What I need is that when I select one sub field of Groups I get the correct value in chart.

How should I define set analysis and expression so I can get what I need?

Thanks.

 

 

 

 

 

Labels (1)
0 Replies