Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

General If show condition

Hello Experts,

I am trying to hide some charts based on the conditions as seen below:

if(LTVType.Description = 'LTV (BTL)'& if(Granularity = 'YTD'),1,0) --- If i use this show condition, it doesnt work

if(LTVType.Description = 'LTV (BTL)', if(Granularity = 'YTD',1,0)) --- If i use this show condition, it shows up whenever I click on YTD ignoring the LTV BTL...

I want to check it to check for both the show conditions... am i doing something wrong?? please suggest.


Thanks in advance

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

The conditional should be using AND instead, as in

if(LTVType.Description = 'LTV (BTL)' AND Granularity = 'YTD', 1, 0)

But what you say seems like everytime you select "YTD" in Granularity, "LTV (BTL)" is selected as well in the LTVType.Description field, maybe because both tables are associated? That explains that everytime you click "YTD" in Granularity the first part of the first If() is true. You may need to use GetFieldSelections() or Count() instead.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

View solution in original post

3 Replies
Miguel_Angel_Baeyens

Hi,

The conditional should be using AND instead, as in

if(LTVType.Description = 'LTV (BTL)' AND Granularity = 'YTD', 1, 0)

But what you say seems like everytime you select "YTD" in Granularity, "LTV (BTL)" is selected as well in the LTVType.Description field, maybe because both tables are associated? That explains that everytime you click "YTD" in Granularity the first part of the first If() is true. You may need to use GetFieldSelections() or Count() instead.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Use And keyword instead of &.

   So your expression will be

    if(LTVType.Description = 'LTV (BTL)' and Granularity = 'YTD',1,0)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hello Miguel,

Today I realised that there is a difference between using & - and for the conditions.... anyways thanks for the help it worked exactly.

Mady