Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to make 1 out of 2 conditions in a calculated dimension to ignore the current selection

Hi,

I am new in Qlikview and I've been searching discussions regarding IF statements within calculated dimensions but unfortunately, I haven't come up with a solution similar to what I am working on.

I have an IF condition statement in the dimension of a chart where it returns 1 (or true) if function is equal to 'Function1'.

Now, I wanted to add Year in my filters but was hoping that whatever year I select should not affect the results of this chart.

Here's my first expression:

=If(FUNCTION='Function1',1)

Any suggestion is highly appreciated.

Thanks.

5 Replies
sunny_talwar

May be like this:

=If(FUNCTION='Function1' and Only({<Year>}Year) = 2016, 1)

Replace 2016 with whatever year you are looking for it to be. Although, I must confess, I don't really understand the logic behind what you are trying to do here. So, don't hate me if this doesn't work . Instead try to provide more details, so that we can help you better here.

Best,

Sunny

ramoncova06
Specialist III
Specialist III

If I understood right, the issue is not with the calculated dimension, but the selection of year affecting the results, correct ?

if so you can ignore that selection in the expression you are using

sum({<Year=>}Value)

Not applicable
Author

Hi Gents, thank you all for the responses.

To make the picture clearer, I have 6 charts that follow values from 5 different sets of filters(Region, Country, Function and Year). The chart I am working on lists down all the Applications currently in use for this specific function which is 'Function1'.

Currently, there are 2 things in the dimensions section of this chart, first is 'Application', second is a calculated dimension which I believe lets this selection get its values specifically from Function1 only.

=If(FUNCTION='Function1',1)

I wanted it to disregard any selected value from the 'Year' filter so it should list down all Applications of Function1 no matter what Year was selected. Hope this is clearer.

Thank you very much for your assistance.

Not applicable
Author

Hi Gents, thank you all for the responses.

To make the picture clearer, I have 6 charts that follow values from 5 different sets of filters(Region, Country, Function and Year). The chart I am working on lists down all the Applications currently in use for this specific function which is 'Function1'.

Currently, there are 2 things in the dimensions section of this chart, first is 'Application', second is a calculated dimension which I believe lets this selection get its values specifically from Function1 only.

=If(FUNCTION='Function1',1)

I wanted it to disregard any selected value from the 'Year' filter so it should list down all Applications of Function1 no matter what Year was selected. Hope this is clearer.

Thank you very much for your assistance.

ramoncova06
Specialist III
Specialist III

do you need the "1" from the calculated dimension ?

if not I would suggest putting this code in a set analysis

sum({<FUNCTION = p (Function1), Year=>}Value)