Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
HitcH
Partner - Contributor II
Partner - Contributor II

Default state applied to alternate state chart

Hello guys,

I have a QV with two sheets.

The first (default state) one has a list box with inherited state, and one element filtered.

On the second sheet I have a chart with an alternate state, but I'm not able to modify my selections on it, as it gets the data from the list box in sheet 1.

 

Example:

Dimension 'People': values are 'I', 'you', 'he', 'she'...

Sheet 1 - default state

List box (inherited state) in sheet 1 - dimension 'People' I select only value 'you'

 

Sheet 2 - alternate state

Chart showing 'People': 'I', 'you', 'he', 'she'

 

I hope it is clear.

Thanks in advance for your help!

1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

Yes that's impacting it, that is for the entire set.  I'm not sure why you need $ if you are hard coding to 2020, but if you want your alt state to use the Calendar year from default state, you can do this:

 

sum({<[Calendar year] = P({$} [Calendar year]) >} [Expression])

View solution in original post

8 Replies
stevejoyce
Specialist II
Specialist II

your expressions can reference different states.  So your selection is being made in default state but your objects are in an alternate_state.  your expression can be:

sum({<People = (P{$} People)>} value)

HitcH
Partner - Contributor II
Partner - Contributor II
Author

Hi Steve,

I think I understand your point, but I would like to avoid changing expression and using set analysis.

I usually have alternate states for every sheet in my QV, on each one of them I use different filters, I just don't understand why on this sheet my filter is linked to the default state, and how could I "separate" them.

Can you help me with this?

Thanks again! 🙂

stevejoyce
Specialist II
Specialist II

Can you make sure each object is set to state Inherited.  There's a hierarchy of state inheritance, but assuming it's just a list box on a sheet (no container) it will be in the same state as your sheet.

HitcH
Partner - Contributor II
Partner - Contributor II
Author

Apparently not.

As you can see, my chart has the alternate state "BB", and dimension "Canale" is showing 5 different values

1.jpg

Still, the current selection box (with alternate state "BB") has only one value selected for dimension "Canale":

2.jpg

So I don't understand why I see 5 of them in the first chart

stevejoyce
Specialist II
Specialist II

Is your table's expressions ignoring selections Or using $ in them {$} that is looking back to your default state. 

 

HitcH
Partner - Contributor II
Partner - Contributor II
Author

Hi Steve,

In my expression I'm using a set expression with $ but it is referred to a different dimension.

I understand now that probably this has an impact also on other dimensions:

 

(sum({$<[Calendar year] = {2020}>} [Expression])

This one above is one of the expressions that I'm using. How should I modify the syntax in order to "fix" the year and to have the other dimension operating on the alternate state?

Thanks again, I think that we are close to the final solution 😄

stevejoyce
Specialist II
Specialist II

Yes that's impacting it, that is for the entire set.  I'm not sure why you need $ if you are hard coding to 2020, but if you want your alt state to use the Calendar year from default state, you can do this:

 

sum({<[Calendar year] = P({$} [Calendar year]) >} [Expression])

HitcH
Partner - Contributor II
Partner - Contributor II
Author

Thank you very much Steve.

Actually, it was not really needed to use the $ on the calendar year. I simply removed it and now it is working fine.

 

I really appreciated your help!! Have a nice day 🙂