Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have columns like Linkid,state,end1,end2.
Linkid contains numbers like 1...10.
state contains 0,1,2 ,1,0,1,1,0,2,1
end1 contains Yes,No like repetitively upto 10 rows
end2 also contains Yes,No upto 10 rows.
Now my requirement is i need to divide state into 4 stages based on state,end1,end2.
Stage0 =total count of linkid.
Stage1=selection of state(0,1)
Stage2=selection of state(0,1) and end1(Yes)
Stage3=selection of state(0,1) and end1(Yes) and end2(Yes)
The above i have created in script like
if(state=0 and state=1,'Stag1',
if(state=0 and state=1 and end1='Yes','Stag2',
if(state=0 and state=1 and end1='Yes' and end2='Yes','Stag3'))) as Newstate,(I haven't included Stage0 could you please check)
After reloading i haven't got any data for newstate showing empty.May be i have done wrong in script part of if condition.
Please check attachment of excel data and qlikview file below.
Could you please help me on that with including Stage0?
Thanks,
Kanna
Thanks for your help..I have 18000 records like that i can't create new stage for all
Dear Rajesh,
Then I think you need to use listed below IF else condition,
if(state=0 or state1=1 and end1='Yes' and end2='Yes','Stag3',
if(state=0 or state1=1 and end1='Yes','Stag2',
if(state=0 or state1=1,'Stag1'))) as Newstate
Kind regards,
Ishfaque Ahmed
I tried that but it is loading only stage1 after reloading..it's not taking
stage2 and stage3.
try like this...
IF((State=0 or State=1) and end1='Yes' and end2='Yes','Stage3',
IF((State=0 or State=1) and end1='Yes' ,'stage2',
IF((State=0 or State=1),'stage1'))) as NewState
Dear Rajesh,
Have you tried this expression as I share you in last post,
if(state=0 or state1=1 and end1='Yes' and end2='Yes','Stag3',
if(state=0 or state1=1 and end1='Yes','Stag2',
if(state=0 or state1=1,'Stag1'))) as Newstate
I have checked and found that it was working fine, reference screenshot is attached with this post. Please check.
Kind regards,
Ishfaque Ahmed
Hello
you cant write AND between two condition which have same field like in your script
state=0 AND state=1
try this expression in you load script
if(state=0 OR state=1,'Stag1',
if((state=0 OR state=1) AND end1='Yes','Stag2',
if((state=0 OR state=1) AND (end1='Yes' OR end2='Yes'),'Stag3'))) as Newstate
hope this help you
Thanks & Regards
Ahmar Ansari