Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to convert the expression below for Qlik to understand.
case when SUM((CASE WHEN ((((TRIM(`FIELD1`) = 'VALUE1') AND (TRIM(`FIELD2`) = 'VALUE2')) AND (TRIM(`FIELD3`) != ‘VALUE3')) AND TRIM(`FIELD4`) IN ('VALUE4','VALUE5')) THEN 1 ELSE 0 END )) > 0 then
(
SUM((CASE WHEN ((((TRIM(`FIELD1`) = ' VALUE1') AND (TRIM(`Source`) = ' VALUE2')) AND (TRIM(`FIELD3`) != ‘VALUE3')) AND TRIM(`FIELD4`) NOT IN ('VALUE6', 'VALUE7')) THEN 1 ELSE 0 END ))
I have been using sum(if(match()) to perform the count but here having a condition of > 0 is giving me difficulties. But this is easy I guess.
Thank you in advance.
If() function seems to be an appropriate equivalent, in combination with a match(), just as you stated.
Note that you need to use three if() functions (you have three cases, two embedded in first)
Something like
=If(
Sum( If( Trim(FIELD1) = 'VALUE1' and Trim(FIELD2) ='VALUE2' and Trim(FIELD3) <> 'Value3' and Match(Trim(FIELD4), 'VALUE3','VALUE5'),1,0)) >0,
Sum(If (.....))
)
what's the issue with the >0 condition?
If() function seems to be an appropriate equivalent, in combination with a match(), just as you stated.
Note that you need to use three if() functions (you have three cases, two embedded in first)
Something like
=If(
Sum( If( Trim(FIELD1) = 'VALUE1' and Trim(FIELD2) ='VALUE2' and Trim(FIELD3) <> 'Value3' and Match(Trim(FIELD4), 'VALUE3','VALUE5'),1,0)) >0,
Sum(If (.....))
)
what's the issue with the >0 condition?
Thank you Stefan, I had difficulties on syntax