Skip to main content

Water Cooler

This space is for everyone to ask questions related to the Community Platform. It's a space for us to get to know each other and have some fun! Come in and gather around the Water Cooler!

Announcements
Have an amazing Qlik Success Story? Share it at QlikWorld! Submit Your Story
cancel
Showing results for 
Search instead for 
Did you mean: 
Ansh
Contributor
Contributor

Nullify selection values in if statement

Hi,

My requirement is to nullify the selection in if statement.

I have year as a filter and I want to nullify its value even if particular year is selected and this has to  be done in an if statement.

My expression is :
if(product='Cards',sum({<year=>}sales),

if(product='MF',sum({<year=>}gross_sales))   

If I am selecting year =2019, I need to get all years of data but I am getting only 2019 data. If I use   sum({<year=>}sales) without using If its is working as expected.

Please suggest.

Thanks                        

Labels (1)
1 Solution

Accepted Solutions
agigliotti
Partner - Master III
Partner - Master III

maybe this:

=sum( {<year=>} if( product='Cards', sales,
if( product='MF', gross_sales )
)
)

View solution in original post

2 Replies
agigliotti
Partner - Master III
Partner - Master III

maybe this:

=sum( {<year=>} if( product='Cards', sales,
if( product='MF', gross_sales )
)
)

Ansh
Contributor
Contributor
Author

It works but I have few more fields in the set analysis which are different in both the cases. 

So in actual it is 

=if( product='Cards', sum({<country='China', code='106',forecast=$(vmax_cycle)>}sales),
if( product='MF', sum({<country='SGH', code='160',forecast=$(vmax_cycle)>}gross_sales )
)
)

Please suggest