Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
dselgo_eidex
Partner
Partner

Chart dimensions with different alternate states

Hello, I have a bar chart with two dimensions on it. If possible, I would like these two dimensions to be on separate alternate states. This way, selecting on one of the dimensions will only make that selection on that alternate state.

For instance, let's say Dimension 1 is on Alternate State 1 and Dimension 2 is on Alternate State 2. The expression would calculate over the intersection of these two sets. Currently, I have 1 alternate state set for my chart and the expression is calculating over the 2nd alternate state, but I'm unable to get the behavior I'm looking for. Is it possible to specify separate alternate states for dimensions within a chart?

EDIT:

Here's an example of my problem. You'll notice that I have two charts, both are using State1 as their alternate state because I want to be able to lasso on the dimension to make selections. The bottom chart should be completely independent of selections of Grade, and if you make selections using the grade listbox (State2), the bottom chart isn't affected. But, if you select grade on the top chart's label (State1), the top chart is not affected because of the set analysis, but the bottom one is. Ideally, if I could make it so that I could lasso the schools on the x-axis to make selections in State1 and then lasso grades in the label to make selections in State2, I wouldn't be having this issue.

4 Replies
MK_QSL
MVP
MVP

Consider you have below dimensions and expression

Dimension

Country

Year

Expression

SUM(Sales)

Now if you want Country in State1 and Year in State2

Create two list box

Country (State1)

Year (State2)

Expression

SUM({<Year = State2::Year, Country = State1::Country>}Sales)

dselgo_eidex
Partner
Partner
Author

Yes, this will give my chart the correct behavior based on the listbox selections, but what about the selections made within the chart.

For instance, let's say that the chart's alternate state is set to State 1, and I lasso values for Country. Now State 1 has new selections in Country and you can see these selections in the listbox. Good.

Now let's say I lasso values for Year. Now State 1 has selections for Year even though I only wanted selections for Year to be within State 2. Bad.

The main culprit here is the selections made within a chart. I want selections for fields to only be allowed in specific alternate states, and if I have more than one field as a dimension in the chart, it introduces the possibility of having selections for fields in the wrong states. If I have to, I can check "Read Only" and remove the chart selections altogether, but I'd like to avoid this if possible.

MK_QSL
MVP
MVP

Yes, I can understand the behaviour you have described above.

Can I know the exact you of your above scenario?

If you describe proper use, we might come with another better solution.

dselgo_eidex
Partner
Partner
Author

Sure, if you look at the example I posted above you will see a chart similar to what I'm working on. The chart is in State1 so all selections made on the chart will be in State1. The chart's expression uses the selection for Grade in State2 to calculate, so selecting Grade on the legend has no effect on it. However, the second chart does react if you select Grade on the legend, because State1 has changed to only include Schools with those grades, even though the chart never mentions Grade once. I'm working with these alternate states to provide a better separation between sheets (which has been an issue for us in the past).

The behavior I'm expecting is that when I select School on the chart the selection is in State1, and when I select Grade on the chart the selection is in State2. So that way, the charts that use grade will be affected by the selection, while the charts that don't will remain unaffected.

I also understand that this may not be possible. If I can't get this to make the selections the way I want to, I've gotten help here: Disable selection of a specific chart dimension, but not both on how to block the Grade selection on the chart.