Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
viralkmehta1968
Partner - Contributor II
Partner - Contributor II

Comparison using set expression

Hi,

I have a dropdown 'Bank Name' and a field for grouping of banks called 'Peer Group' (values are 'Assets < 100 million', 'Assets between 100 and 300 million' etc.). I also have a measure 'Net Income' by bank.

I want the user to select a bank from the dropdown and then show the 'Net Income' for the selected bank. Side-by-side, I also want to show the average net income for the 'Peer Group' that the selected bank belongs to. How can I do this? What will be the 'Set expression' to do this? See example below.

                        Selected Bank     Peer Group

Net Income          $11,985            $7,500

Thank you,

8 Replies
viralkmehta1968
Partner - Contributor II
Partner - Contributor II
Author

Please note that 'Peer Group' is an implicitly selected value. What will be the set expression to get the average net income for all banks in the peer group.

vinieme12
Champion III
Champion III

please provide sample dataset that best replicates your scenario or a sample app

QlikCommunity Tip: How to get answers to your post?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

one way could be using e()


Expression for Selected Bank:

Sum(Revenue)


Expression for Other Banks in Peer Group

Sum({<BankName ,BankName = E(BankName) , PeerGroup = P(PeerGroup)>}Revenue)



Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

read more about P() and E() here

https://community.qlik.com/thread/68931

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
viralkmehta1968
Partner - Contributor II
Partner - Contributor II
Author

Thank you, Vineeth.

The set expression using E() and P() worked for me.

vinieme12
Champion III
Champion III

Glad to help,

Can you mark a response as correct and close the thread please

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
viralkmehta1968
Partner - Contributor II
Partner - Contributor II
Author

I see an option 'Mark as Helpful' under 'Actions' but do not see an option to mark the answer as 'Correct'.

vinieme12
Champion III
Champion III

There shud be a big Green button

Qlik Community Tip: Marking Replies as Correct or Helpful

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.