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: 
AdrianS1
Contributor III
Contributor III

Two or more alternate States on one table, is it possible?

Hi guys, I have a small problem. 

I have 2 sheets.

On first sheet I have table which filters two tables on second sheet.

On second sheet i have filter pane which i want  to filter only  one of two tables on a second sheet ( which are already filtered by table on first sheet).

Can i do this ? 

Labels (1)
3 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @AdrianS1 

Alternate states are applied either at a sheet or object level, so a whole table will always have one state.

What you probably want to explore is Set Analysis syntax. This opens up a whole load of possibilities of applying different selections to different measures in the same object.  You can even reference state names in a set analysis statement, should you wish:

sum({State1}Value)

That will give you the sum of the value with the selections from state one applied.

This is referenced in my blog post on alternate states, here:
https://www.quickintelligence.co.uk/alternate-states-in-qlik-sense/

Hope that helps,

Steve

AdrianS1
Contributor III
Contributor III
Author

Yeah but i have dimensions in the tables. I have table with brand on first sheet(1 column brand, 2column sales).On second sheet i have two tables (1 column brand division 1, 2 column sales ans second table 1 column brand division 1,2 column month,3 columm sales)  When I click on table (with brand 1 sheet) on one of the brand, the filter from table is working on both tables on sheet 2.

On second sheet I also have a filter pane with month which i want to filter only one of tables with month on second sheet.

So measures in table on second sheet which i want to filter should Look like sum({State0,State1} Sales)?

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @AdrianS1 

I think the syntax for putting an expression into a state only allows one state at a time.

To be honest, Alternate States always over complicates things and what you are describing doesn't sound like you need to have multiple states within your application.

You may be better dealing with this using set analysis.

With this syntax you can ignore selections in specific fields by setting the selection on them to nothing. So, to add up all values ignoring selections in Month you would have:

sum({<Month=>}Value)

Or you could ignore all selections, with the exception of the Brand dimension by having this:

sum({1<Brand=P({$}Brand)>}Value)

The syntax looks a bit odd, but to unpack that statement: The in the statement ignores all of the user's selections. Brand is there to apply a custom selection to that field. P() allows you to match to possible values in another field or state. {$} within the P puts that subquery into the user selected state and the second Brand field picks out all the Brand values in that state.

Removing your alternate states and finding a decent set analysis tutorial will almost certainly be a good step forward.

Steve