Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sazabi
Creator
Creator

Intersection of Alternate States? Multiple Alternate states per expression?

Hey Qlik Folks!

Hope you are all well.

I have a question involving alternate states.

Is it possible to intersect alternate states? 

 

For example, I have an object containing 2 measures and 1 dimension:

 

Dimension:

1. Timestamp

Measure:

1. sum({state1}some_kind_of_field) 

2. sum({state2}some_kind_of_field)

By having one filter panel for Timestamp per alternate state, I am able to dynamically color portions of the chart for comparison purposes  by making selections in each panel.

eventWevent.png

However, now I want the overall graph to change as I make selections from a single filter panel containing a field related to hierarchy data. 

For example, the current graph is showing the sum() for objects A+B+C. How can I get it so that I have a single filter panel that will control both Alternate States? Is it possible to incorporate multiple alternate states in an expression at a given time? Or something else?

 

I don't want to have a filter panel for each object in this case because if I have 6 or 7 dimension filters that need to go into play, I will end up having 12 or 14 filter panels on a page! Lots of space is lost!!!!

 

Thank you for taking the time out of your busy schedule for reading my rambling, and I hope you enjoy the rest of your day

 

S

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

To intersect with selections from the another state, such as the default, your syntax would be:

sum({state1 * $}some_kind_of_field) 

If you wanted to merge your selections but ignore any Timestamp selections that may be in the default state:

sum({state1 * $<Timestamp=>}some_kind_of_field) 

See https://qlikviewcookbook.com/2016/07/alt-states-merged-selections-tip/ for more. 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

6 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

To intersect with selections from the another state, such as the default, your syntax would be:

sum({state1 * $}some_kind_of_field) 

If you wanted to merge your selections but ignore any Timestamp selections that may be in the default state:

sum({state1 * $<Timestamp=>}some_kind_of_field) 

See https://qlikviewcookbook.com/2016/07/alt-states-merged-selections-tip/ for more. 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Sazabi
Creator
Creator
Author

Super duper cool Rob!!!

 

This is the perfect solution.

 

Thanks!!

 

S

paolo_mapelli
Creator II
Creator II

Doesn't works in Qlik Sense

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It should work in QS.  Do you have a specific counter-example?

-Rob

paolo_mapelli
Creator II
Creator II

My mistake, sorry for false flag.

Anyway, I'm unsuccessfully trying to propagate default state selection of one dimension to the same dimension of an alternate state.

I have a measure set like this: Sum({[Competitive Set]<PY={'0'},[Data.autoCalendar.Month]={'gen'}>}Revenue)   

Now, how can I get the [Data.autoCalendar.Month] value for default state and replace "{'gen'}" in above example?

Tried with Sum({[Competitive Set]<PY={'0'},[Data.autoCalendar.Month]=$::[Data.autoCalendar.Month]>}Revenue) as used in QlikView but it doesn't works.

Any ideas on how to get it?

Thanks in advance.

Paolo

Ronald
Contributor III
Contributor III

Hi, My expression is sum({Funnel * $} NumPreg) but I need conditional this sum with the camp Nombre ='Correos Enviados'

sum({Funnel * $ <Nombre={'Correos Enviados'}>} NumPreg) don´t work