Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

viralkmehta1968
New Contributor

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
New Contributor

Re: Comparison using set expression

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
Esteemed Contributor II

Re: Comparison using set expression

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

QlikCommunity Tip: How to get answers to your post?

vinieme12
Esteemed Contributor II

Re: Comparison using set expression

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)



vinieme12
Esteemed Contributor II

Re: Comparison using set expression

read more about P() and E() here

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

viralkmehta1968
New Contributor

Re: Comparison using set expression

Thank you, Vineeth.

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

vinieme12
Esteemed Contributor II

Re: Comparison using set expression

Glad to help,

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

viralkmehta1968
New Contributor

Re: Comparison using set expression

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

vinieme12
Esteemed Contributor II

Re: Comparison using set expression

Community Browser