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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
oliviatww
Partner - Contributor II
Partner - Contributor II

Possible to use 2 alternate states in one object?

Hi there,

Wondering if possible to apply 2 alternate states in one object? For example, 'field a' (state 1), 'field b' (state 2), 'table a' (state 1) and 'table b' (state 2), So when I select 'field a' data it will only change 'table a' but not 'table b'. Also I have 'year' and 'month' list boxes which I want to apply state 1 and state 2 meaning that when I select year 2013, it will change both 'table a' and 'table b'.

Any help will be highly appreciated.

Thanks

7 Replies
evan_kurowski
Specialist
Specialist

Hello Tze Wee,

It is possible to mix and match alternate states in objects, and that is an intended use of the feature.

You can assign controls to alternate states in 3 areas:

- At the sheet level (everything under the sheet immediately assigns to the specified state)

- At the object level (that specific object moves to the assigned state)

- At the expression level (one or more alternate states may be referenced via set-analysis syntax)


A good place to see examples of referencing multiple states within a single object is within the "What's New In QlikView 11" document, on the 'Product Grouping' tab, there is a chart called 'Comparative Analysis'.

Not applicable

Hi,

Yes you can use two Alternate states in same chart or in diferente chart in the same sheet or one state per sheet.

See attached file, there are two little examples with two states in same chart and one state per chart.

Best regards.

oliviatww
Partner - Contributor II
Partner - Contributor II
Author

Thanks Evan and Oswaldo for your reply.

I knew we can apply alternate state in set analysis, but in my chart expression, i didn't used set analysis or any function like count or sum etc. What my chart expression do is just basically show a field. For example in Oswaldo alternate state.qvw, i didn't use sum({State1} Metric) but instead i used Metric only (I want to show all Metric).

Thanks

evan_kurowski
Specialist
Specialist

Hello Tze,

For returning string values that don't require mathematical calculations, you can use any of the aggregation functions which return strings and accept set-analysis (Only(), FirstSortedValue(), Concat, MinString(), MaxString())

For example a chart dimension that accepts its values from selections made in an alternate state might have

=Aggr(Only({[State1]} Metric), Metric)

oliviatww
Partner - Contributor II
Partner - Contributor II
Author

Thanks so much as I got it works now. Basically I used only function but this function may not work if my data have 2 records with same fields.

Anyway thanks a lot.

bimala0507
Partner - Creator
Partner - Creator

Hi Tze:

Just curious to know, how have you achieved? Since we cannot give 2 states to a single object. Like as per your requirement, changing the value of Month and Year would change both State1 and State2 values.

Kind Regards,

Bimala Mishra

Senior Technical Consultant

Tel: +65-63378471; Extn : 102

HP: 93854602

oliviatww
Partner - Contributor II
Partner - Contributor II
Author

Hi Bimala,

I didn't apply two states to a single object but instead I used only() function for my expressions in both table where each table expression set analysis uses different state. For example, 'table a', 'table b', 'year' and 'month' listboxes, these four stuff uses inherited state, where 'field a' is state 1 and 'field b' is state 2. I applied state 1 to 'table a' expression set analysis and applied state 2 to 'table b' expression set analysis.

This work fine for cases when there is only one possible value when you use only() function, but not when there is more than one value.

Thanks.