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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filtering Dimensions with a formula

Hi everyone,

I am new to QlikSense and I have a rather basic question: I try to set up a table which has only two rows:

- FinancialAccounts (drill down dimension with 3 levels)

- Values (measure: sum() )

Now what I try to do is to "pre-filter" the dimension "Financial Account" in the respective formula, so that only the Accounts are shown, which have the ID = 11. This concerns only the first level of the drilldown.

I know there is the possibility to filter the values in the measure with:  sum({$<FinancialAccountsID={"11"}>}Values)

But then the table does not show anymore the first level of the drilldown - it only shows the second level!

I tried the following (formula in the dimension), which did not work: if(FinancialAccountsID={"11"},FinancialAccountsID,null())

I hope you guys can help me!

2 Replies
preminqlik
Specialist II
Specialist II

only({<FinancialAccountsID={"11"}>}FinancialAccountsID)

or

if(FinancialAccountsID=11,FinancialAccountsID,null())


or


if(aggr(sum({$<FinancialAccountsID={"11"}>}Values),FinancialAccountsID),FinancialAccountsID)

Not applicable
Author

Thank you very much for your help!

I have a final question: Is it possible within a measure to connect several if-statements?

For example:

If the ID is 11, then sum up ID 12, 13 and 14

If the ID is 15, then sum up ID 16 and 17

Edit: The thing is, I would like to calcuate subtotals in a table (which have an ID: 11 and 15 in the example, e.g. 11 for EBITDA, 15 for EBIT). Is there may a better way?