Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

danielle_v
Contributor

Alternate States & Selections

Hi All,

Just beginning to explore the possibilities of alternate states and have a question I haven't managed to find the answer to.

Basically, I have a pivot table that compares factory statuses by factory name and I have set up 2 alternate states (MonthYearOne & MonthYearTwo) in order to allow the user to choose 2 months to compare.

My problem is that I want all other selections made in the document to apply to the pivot table. I have amended the expression as per the below to allow enable to the table to take into account any selections made on the [Factory Name] field, but want to know if there is any way of allowing selections on all other fields to be taken into account in the alternate state, without having to explicitly include each field name in the expression? I ave numerous other fields that users may want to make selections on in this pivot table.

=if(concat( { MonthYearOne <[Factory Name] = $:: [Factory Name]>} DISTINCT [Factory Status], ', ') <>

     concat( { MonthYearTwo <[Factory Name] = $:: [Factory Name]>} DISTINCT [Factory Status], ', '),

          concat( { MonthYearOne <[Factory Name] = $:: [Factory Name]>} DISTINCT [Factory Status], ', ') )

Any pointers much appreciated!

1 Solution

Accepted Solutions
MVP
MVP

Re: Alternate States & Selections

Maybe just use the default set as set identifier and use a set modifier for the MonthYear?

=if(concat( { $<MonthYear = MonthYearOne::MonthYear >} DISTINCT [Factory Status], ', ') <>

     concat( {$<MonthYear = MonthYearTwo::MonthYear >} DISTINCT [Factory Status], ', '),

          concat({ $<MonthYear = MonthYearOne::MonthYear >} DISTINCT [Factory Status], ', ') )

edit: You might need to clear user selections on other calendar fields to avoid incompatible sets, like

=if(concat( { $<MonthYear = MonthYearOne::MonthYear, Date= >} DISTINCT [Factory Status], ', ') <>

     concat( {$<MonthYear = MonthYearTwo::MonthYear , Date= >} DISTINCT [Factory Status], ', '),

          concat({ $<MonthYear = MonthYearOne::MonthYear, Date= >} DISTINCT [Factory Status], ', ') )

2 Replies
MVP
MVP

Re: Alternate States & Selections

Maybe just use the default set as set identifier and use a set modifier for the MonthYear?

=if(concat( { $<MonthYear = MonthYearOne::MonthYear >} DISTINCT [Factory Status], ', ') <>

     concat( {$<MonthYear = MonthYearTwo::MonthYear >} DISTINCT [Factory Status], ', '),

          concat({ $<MonthYear = MonthYearOne::MonthYear >} DISTINCT [Factory Status], ', ') )

edit: You might need to clear user selections on other calendar fields to avoid incompatible sets, like

=if(concat( { $<MonthYear = MonthYearOne::MonthYear, Date= >} DISTINCT [Factory Status], ', ') <>

     concat( {$<MonthYear = MonthYearTwo::MonthYear , Date= >} DISTINCT [Factory Status], ', '),

          concat({ $<MonthYear = MonthYearOne::MonthYear, Date= >} DISTINCT [Factory Status], ', ') )

danielle_v
Contributor

Re: Alternate States & Selections

Thank you so much - this works perfectly!

Now I just need to go away and figure out how it all works :-)

Community Browser