Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
msapre
Contributor II
Contributor II

How to find the sum for not selected variables combined?

So I've created a table that displays total par for whichever Issuer is selected in the below variable input:

msapre_0-1746637841031.png

The filtering variable for the variable input is called 'IssueFilter'

The table displays PARHELD, as well as the 3-month change in PARHELD.

This is the expression for the sum of parheld for the selected date:

sum({<ISSUERCODE = {"$(=[IssueFilter])"}, REPDTE = {"$(=[DateFilter])"}>}PARHELD)

And this is the expression to calculate the 3 month change for parheld:

(sum({<ISSUERCODE = {"$(=[IssueFilter])"}, REPDTE = {"$(=[DateFilter])"}>}PARHELD)) - SUM({<ISSUERCODE = {"$(=[IssueFilter])"},[REPDTE.autoCalendar.Date]={"$(=MONTHEND(ADDMONTHS([DateFilter], -3)))"}>} PARHELD)

 

What I wish to do is add 2 more columns. The first column will calculate PARHELD for the remaining 3 variables not selected in IssueFilter, and the other will calculate the 3 month change for IssueFilter. How would I go about achieving this?

 

Thanks!

1 Reply
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @msapre 

If I am understanding your question right I think you are just needing the excludes syntax in set analysis, which is simply a case of adding a minus sign:

ISSUERCODE-={"$(=[IssueFilter])"}

The way you have written this means it will fail if there is ever more than one IssueFilter in play. If this is the intention then that is great. If not, you could allow multiple selections in the filter and use the P() and E() functions.

Assuming the values in ISSUERCODE and IssueFilter are the same, the ones that match are:

ISSUERCODE=P(IssueFilter)

And the excluded ones are:

ISSUERCODE=E(IssueFilter)

You could use that for the single selection also, but the minus equals is slightly simpler syntax.

Hope that helps.

Steve