Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
knightwriter
Creator III
Creator III

Alternate states: Sum(AS1 + AS2) for AS3?

Hi All,

Is it possible to have a 3rd alternative state to include both alternate state 1 and 2.

Example, I have cars sold ytd with a set of filters (s1) and a pipeline of cars to be sold for the rest of the year with separate filters (s2), I am looking to create a 3rd Alternative state to include salesperson, so when I select the sales person both s1 and s2 will match the salesperson selected in s3.

All help appreciated.

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I think this is what you are looking for:

- Use the Salesperson list box in the Default state, or in a separate state AS3.

- in your chart expressions that show metrics for AS1 and AS2, add another modifier that enforces the selection of the Salesperson from AS3. Something like this:

sum({AS1<SalesPerson=P({AS3} SalesPerson)>}   CarsSold)

In this expression, the aggregation is performed over the data defined by Alternate State AS1, while the Salesperson selection is driven by the available values of the SalesPerson in AS3.

Or, as Stephan suggested:

sum({AS1<SalesPerson=AS3::SalesPerson>}   CarsSold)

This time, you assign the selected values from AS3. The difference between the two expressions is very subtle.

cheers,

Oleg Troyansky

QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense

View solution in original post

7 Replies
swuehl
MVP
MVP

You can use the scope operator :: to mix states in set analysis.

For example:

=Sum( {s1<salesperson = s3::salesperson>} Value)

considers alternate state s1 in general, but assigns the s3 selected salesperson to salesperson in state s1.

knightwriter
Creator III
Creator III
Author

Hi swuehl,

Thanks for the note. I've never heard of the scope operator, so something new to learn.

I want the multi box dropdpwn by salesperson (s3) to include this scope operator, where do I use this expression you suggest? Under Multi Box Properties -> 'Sort' and 'Expression'?

swuehl
MVP
MVP

No, probably not under 'expression' in sort tab. Not really sure what you want to achieve, though.

Could you upload a small sample QVW that demonstrates your setting and what you want to achieve?

knightwriter
Creator III
Creator III
Author

Hi swuehl,

I have 2 sections:

  • section one uses one set of filters with Alternate State 1
  • section two uses another set of filters with Alternate State 2

What I am looking for is to create a list box, that when selected, will apply to both sections.

swuehl
MVP
MVP

What do you mean with 'section'? A chart?

As I tried to explain above, you can create a mixup of states (e.g. your Alternate State 1 that you first section uses with the default state / another alternate state that your list box is set to) in your aggregation using set analysis.

Alternatively, you can think about copying the list box selections to the appropriate fields in Alternate State 1 and 2 using field event trigger and select in field actions.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I think this is what you are looking for:

- Use the Salesperson list box in the Default state, or in a separate state AS3.

- in your chart expressions that show metrics for AS1 and AS2, add another modifier that enforces the selection of the Salesperson from AS3. Something like this:

sum({AS1<SalesPerson=P({AS3} SalesPerson)>}   CarsSold)

In this expression, the aggregation is performed over the data defined by Alternate State AS1, while the Salesperson selection is driven by the available values of the SalesPerson in AS3.

Or, as Stephan suggested:

sum({AS1<SalesPerson=AS3::SalesPerson>}   CarsSold)

This time, you assign the selected values from AS3. The difference between the two expressions is very subtle.

cheers,

Oleg Troyansky

QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense

knightwriter
Creator III
Creator III
Author

I wasnt exactly sure how to apply the expression so thank you for the detailed response, much appreciated.