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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
lukasrubner
Contributor
Contributor

If statement prevents ignoring of field selections

Hello Everybody,

I am currently facing an issue with excluding field selections in a table. Attached is the datamodel of my application. It consists of 2 datasets. One containing "projects" with an agreed savings potential for a KPI and another one with detail data on actual activities.

The table I have trouble with looks like this:

Country NameSystemgroupKPISavings TargetSavings YTD
ArgentinaAKPI_11000500
ArgentinaBKPI_2200100

 

Here, Savings YTD roughly looks like this:

If(KPI = 'KPI_1', Savings_Calculation1,

if(KPI = 'KPI_2'; Savings_Calculation2)

These Savings calculations are all using the detail dataset.

 

Since I want this table to be static, I excluded Systemgroup from all calculations with a "Systemgroup=" in the set expression. Without selecting a Systemgroup everything seems to be working fine. Each KPI gets the right calculation and all Savings YTD are displayed. However, once I select a Systemgroup all values except for the ones for this Systemgroup dissappear. For example, selecting Systemgroup "A" would make the 100 dissappear.

Weirdly, if I just look at a single KPI and remove the if statement from the savings YTD calculation, selections do not affect the outcome.

Can you help me with this?

Thank you!

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Try this

If(Only({1} KPI) = 'KPI_1', Savings_Calculation1,
If(Only({1} KPI) = 'KPI_2', Savings_Calculation2))

View solution in original post

2 Replies
sunny_talwar

Try this

If(Only({1} KPI) = 'KPI_1', Savings_Calculation1,
If(Only({1} KPI) = 'KPI_2', Savings_Calculation2))
lukasrubner
Contributor
Contributor
Author

It works! Thank you!