Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

kunkumnaveen
Contributor III

how to write if else condition

Hello All,

I am merging both expression by using or function is that correct  ,what it mean  is either one scenario is right then show spend,but I thinking the way I am merging is not correct ,because I am getting -1 as output of all the materials

Sum({<SCOPE={'Yes'},MATL_TYPE={'HALB','ROH'},New_Column={"=New_Column<>p_Material"}>}SPEND) or

Sum({<SCOPE={'Yes'},MATL_TYPE={'HALB','ROH'},New_Column={"=New_Column=p_Material"} ,p_Material={"=count(distinct Ip_ID)=1"}>}SPEND)

1 Solution

Accepted Solutions
jmvilaplanap
Valued Contributor

Re: how to write if else condition

Sorry, is with a "+"

Sum({<SCOPE={'Yes'},MATL_TYPE={'HALB','ROH'},New_Column={"=New_Column<>p_Material"}> + <SCOPE={'Yes'},MATL_TYPE={'HALB','ROH'},New_Column={"=New_Column=p_Material"} ,p_Material={"=count(distinct Ip_ID)=1"}>}SPEND)

5 Replies
jmvilaplanap
Valued Contributor

Re: how to write if else condition

Hi,

Why you don't merge both expressions in one single set analysis?

Sum({<SCOPE={'Yes'},MATL_TYPE={'HALB','ROH'},New_Column={"=New_Column<>p_Material"}> <SCOPE={'Yes'},MATL_TYPE={'HALB','ROH'},New_Column={"=New_Column=p_Material"} ,p_Material={"=count(distinct Ip_ID)=1"}>}SPEND

I think this will work

jmvilaplanap
Valued Contributor

Re: how to write if else condition

Sorry, is with a "+"

Sum({<SCOPE={'Yes'},MATL_TYPE={'HALB','ROH'},New_Column={"=New_Column<>p_Material"}> + <SCOPE={'Yes'},MATL_TYPE={'HALB','ROH'},New_Column={"=New_Column=p_Material"} ,p_Material={"=count(distinct Ip_ID)=1"}>}SPEND)

kunkumnaveen
Contributor III

Re: how to write if else condition

thanks for your reply,one doubt

will + work same as or function,because i need either one expression is true then show spend

Re: how to write if else condition

Yes and i would ask you to read related stuff which "Set Analysis Operators in Qlikview"

Life is so rich, and we need to respect to the life !!!
jmvilaplanap
Valued Contributor

Re: how to write if else condition

Hi,

This + work as an OR operator

Community Browser