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: 
Not applicable

Condition on Selections

Hello Friends,

I have one chart over which I want calculation condition. The chart should be visible only after the fulfillment of condition.

Eq.-

Suppose I have following fields -

State

City

Maha

Mum

Pun

Chand

My requirement is when user selects any below combination like

Maha and Mum

Maha and Pun

Mum and Pun

Mum and Chad

Chand and Mum

Chand and Pun ……etc

Then it should display chart respective to above selection but I don’t want to display the chart for below selection

State-Maharashtra

City- Chandi..

If user selects this combination (Maha-Chand) it should give error msg. of calculation condition unfullfilment.

5 Replies
kuczynska
Creator III
Creator III

Hi,

Can you explain how exactly your data model is build? If State and City are two columns in the same table, you won't be able to make Mum and Pun selection, as they are coming from two different rows and are excluding each other...

sc1.PNG

But if your data model would be build in a slightly different way (apologies, I really have no idea about the true geography of India...), like the below:

* INLINE [
    State, City
    Maha, Mum
    Pun, Chand
    Maha, Chand
    Pun, Mum
]
;


You will be able to make all of the mentioned selections:

sc1.PNG

In that case - please check the attached qvw. You can display a text box for example with any custom message; it's displayed conditionally depending on the value of the variable.

Anonymous
Not applicable
Author

Try on Chart Layout condition with your required combination"

say chart1, you want to use for State='maha' and city='mum'

then at layout condition of respective chart use:

=Index(GetFieldSelections(State, ',' ,50),'Maha')<>0 & =Index(GetFieldSelections(City, ',' ,50),'Mum')<>0

where 50 is number of string values of State are allowed rest you can increase or decrease based on your req.

Hope this will help.

Not applicable
Author

Hi,

I think, even for the first scenario (State and City are two columns in the same table) there would be a way to achieve selecting data that does not belong to the same row. If you create two Listboxes (State and City) and give each Listbox a different alternate state, you can use the selection from each alternate state in your chart by using Set Analysis functionality.

Cheers,

Claus

sudeepkm
Specialist III
Specialist III

if you have data in such a way that same city name appears under different States and your requirement is to select specific City respective to a particular State then you may think of using a drill group that can have both State and City and you can name the group as Location. then you can use the group in a list box.

so when an end user selects a particular State then only Cities belonging to that State will appear in the list box.

It will follow the hierarchy.  Snap shot given below.

NOTE: if user selects multiple states then the Cities won't be displayed.

T180177.PNG

Not applicable
Author

Hello friend,

Please check the following snapshot and conditions-

snap1.jpg

If user selects ''DOM' button in combination with "FORM" button then the Analysis chart should show error message. The chart should be visible for other combinations like DOM - A, Ex - FORM etc except DOM-FORM.

So what condition should i use in Calculation condition