I have used the below logic for nested if else condition.
I want to create a logic which says that if none of the conditions match the criteria, it should show as "marginal"
IF [Change]=0 THEN "No change"
ELSEIF [PQ FD %]>15 and [Current FD Own %]<15 then "Change below 15%"
ELSEIF [PQ FD %]>20 and [Current FD Own %]<20 then "Change below 20%"
ELSEIF [PQ FD %]>25 and [Current FD Own %]<25 then "Change below 25%"
ELSEIF [PQ FD %]>50 and [Current FD Own %]<50 then "Change below 50%"
ELSEIF [PQ FD %]<15 and [Current FD Own %]>15 then "Change above 15%"
ELSEIF [PQ FD %]<20 and [Current FD Own %]>20 then "Change above 20%"
ELSEIF [PQ FD %]<25 and [Current FD Own %]>25 then "Change above 25%"
ELSEIF [PQ FD %]<50 and [Current FD Own %]>50 then "Change above 50%"
ELSEIF [PQ FD %]=0 and [Current FD Own %]>0 then "New Investment"
ELSEIF [PQ FD %]>0 and [Current FD Own %]="" then "Liquidation"
else "marginal"
ENDIF
But somehow It is not working properly. As the highlighted Category column show ideally display as "marginal"
Any help would be amazing.
Thanks!
Solved! Go to Solution.
Hey @madhurinani, what are you checking for in this last line?
ELSEIF [PQ FD %]>0 and [Current FD Own %]="" then "Liquidation"
Where you have ="", Alteryx is checking for a blank string value because of the quotation marks, whereas all of your other conditions are based on numeric checks. Are you looking for a blank/null here? If so, you could perhaps try using AND isempty([Current FD Own %]) or AND isnull([Current FD Own %]).
Hey @madhurinani,
Like @DataNath found all you need to do is change this check to something like NULL(). You cant compare a number to text.
IF [Change]=0 THEN "No change"
ELSEIF [PQ FD %]>15 and [Current FD Own %]<15 then "Change below 15%"
ELSEIF [PQ FD %]>20 and [Current FD Own %]<20 then "Change below 20%"
ELSEIF [PQ FD %]>25 and [Current FD Own %]<25 then "Change below 25%"
ELSEIF [PQ FD %]>50 and [Current FD Own %]<50 then "Change below 50%"
ELSEIF [PQ FD %]<15 and [Current FD Own %]>15 then "Change above 15%"
ELSEIF [PQ FD %]<20 and [Current FD Own %]>20 then "Change above 20%"
ELSEIF [PQ FD %]<25 and [Current FD Own %]>25 then "Change above 25%"
ELSEIF [PQ FD %]<50 and [Current FD Own %]>50 then "Change above 50%"
ELSEIF [PQ FD %]=0 and [Current FD Own %]>0 then "New Investment"
ELSEIF [PQ FD %]>0 and [Current FD Own %]=NULL() then "Liquidation"
else "No Change"
ENDIF
Thank you both.
Understood on the mistake on my last ELSEIF condition, the code wasn't reaching the last part of the ELSE condition due to that.
I have fixed that.
Thank you both for your help.
User | Count |
---|---|
105 | |
82 | |
70 | |
54 | |
40 |