Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
cmenszak1
Contributor II
Contributor II

If than based on selections

I have a Qlik Sense app where I have dimensions for distributor name and distributor code plus one measure for sales.  I am trying to create a table that shows sales data using the distributor name when it is selected in the distributor name filter box or distributor code for the distributor names not selected.  I am using set analysis to show sales for all distributors regardless of the distributor name selections.  I need this to work if one or multiple distributor names are selected.

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Try an expression like this:

=AGGR(if( ONLY({1}DistributorName)=ONLY(DistributorName),
DistributorName,
ONLY({1}DistributorCode))
, DistributorName)

 

See attached QVW

View solution in original post

3 Replies
Vegar
MVP
MVP

I found it hard to pinpoint the core of your problem. Do you think you could post a sample of what you are trying to do? It should be easier to help you if you do so.

-Vegar

cmenszak1
Contributor II
Contributor II
Author

I attached a sample Qlikview app. 

There is a chart in the app that I want to show the DistributorName for all selected in the DistributorName list box and the DistributorCode if the DistributorName is not selected.

 

Vegar
MVP
MVP

Try an expression like this:

=AGGR(if( ONLY({1}DistributorName)=ONLY(DistributorName),
DistributorName,
ONLY({1}DistributorCode))
, DistributorName)

 

See attached QVW