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

Excluding a selection

Hi all,

I have a simple chart showing values using the expression:
=Round(sum(Value)/1000, 0.1)

The user makes selections from two dimensions: Product and Account.

When the user selects a products, the chart will show total value for that product.

My requirement is as follows: when the user makes a selection from Accounts, the chart will just exclude that selected account from the calucation.

I tried to use Set Analysis like {1-$} but that would affect both the Product and Accounts.

I tried to use something like follows:

=Round(sum( {$<[Account_Name]=>} Value)/1000, 0.1) - Round(sum( {$<[Account_Name]=[Account_Name]>} Value)/1000, 0.1)

but that doesn't work if no account is selected. It will display zero.

Thanks in advance.

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

You will have to change the Set Expression. You can use the following expression

=if(getselectedcount([Account_Name])>0,

Round(sum( {$<[Account_Name]=>} Value)/1000, 0.1) - Round(sum( {$<[Account_Name]=[Account_Name]>} Value)/1000, 0.1),

Round(sum( {$<[Account_Name]=>} Value)/1000, 0.1) )

View solution in original post

5 Replies
Not applicable
Author

Hi,

Plz share sample database.

suniljain
Master
Master

Pls use Set analysis it will help you .you can get more help about set analysis from qlikview help.

Not applicable
Author

I am attaching a sample file.

What I need is: if I select an account, let's say "A5", and a product "P2", I want the calculation in the chart to be summition of Value for ALL accounts except "A5" and summition of product "P2" only.

Thanks in advance.

Not applicable
Author

Hi,

You will have to change the Set Expression. You can use the following expression

=if(getselectedcount([Account_Name])>0,

Round(sum( {$<[Account_Name]=>} Value)/1000, 0.1) - Round(sum( {$<[Account_Name]=[Account_Name]>} Value)/1000, 0.1),

Round(sum( {$<[Account_Name]=>} Value)/1000, 0.1) )

suniljain
Master
Master

Pls check