Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

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
Specialist
Specialist

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)

View solution in original post

5 Replies
jmvilaplanap
Specialist
Specialist

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
Specialist
Specialist

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
Specialist
Specialist
Author

thanks for your reply,one doubt

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

Anil_Babu_Samineni

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jmvilaplanap
Specialist
Specialist

Hi,

This + work as an OR operator