Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
mayuranp
Creator
Creator

Alternate States - Apply filters from default state and an alternate state

I need to have sales reports to compare between two date ranges.

Here is a simple example to explain my query.

  • Created 2 alternate states
    1. Group 1
    2. Group 2
  • Created two tables
    1. Sales by Products 1
      • Expression : sum ({ [Group 1] } Sales)
    2. Sales by Products 2
      • Expression : sum ({ [Group 2] } Sales)
  • Created two date filters and applied Group 1 state to one of them and Group 2 to the other

Whenever I select dates in the date filters, the sales figures changes correctly in the appropriate table.

Now, I want to have a new filter "Brand" in the same sheet.

I want any selections in Brand filter should apply to both tables. But it is not working? What do I need to do to make this work?

 

Labels (1)
1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

You can reference the selection from different states, by using the syntax [Alternate State Name]::fieldname or for the default state, use $::fieldname, like this:

sum ({ [Group 1]<Brand=$::Brand> } Sales)

sum ({ [Group 2]<Brand=$::Brand> } Sales)

View solution in original post

3 Replies
GaryGiles
Specialist
Specialist

You can reference the selection from different states, by using the syntax [Alternate State Name]::fieldname or for the default state, use $::fieldname, like this:

sum ({ [Group 1]<Brand=$::Brand> } Sales)

sum ({ [Group 2]<Brand=$::Brand> } Sales)

CurroCa
Contributor II
Contributor II

Thanks a lot, it´s been very usefull for me this advice.

If I need to deep in the set analysis, is this the way?

sum ({ [Group 1]<Brand=$::Brand, YEAR={2011}> } Sales)

 

marcusva
Contributor III
Contributor III

Hi, what if I want to be able to apply multiple selections from the default state to the alternate state?

I noticed it's possible to add more than one field, like:

sum ({ [Group 1]<Field1=$::Field1, Field2=$::Field2> } Sales)

But is there another way to do this to all fields at once except the one I'm actively filtering in the alternate state? In my case I have 13 different fields that both states should share selections.

Thanks!