Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am looking for a way to code many different conditions into if statements. The source data is all different and I am trying to generate a new column. There are 16 clients. So far I have:
IF '$(vClientCode)' = 'XXX' THEN
If([compound code]=2,'Compound')
If([drug type]=4 and [Generic Indicator]=Y,'Generic')
If([drug type]=1 or [drug type]=2 or [drug type]=4 or [drug type]=5,'Brand')
Else 'Generic';
IF '$(vClientCode)' = 'XXX' THEN
If([compound indicator]=2,'Compound')
If([SSG Ind]=SSG,'Single-Source Generic')
If([Drug Indicator]<>Y,'Brand')
Else 'Multi-Source Generic';
IF ('$(vClientCode)' = 'XXX' ,
If([compound code]=2,'Compound',
If([drug type]=4 and [Generic Indicator]=Y,'Generic',
If([drug type]=1 or [drug type]=2 or [drug type]=4 or [drug type]=5,'Brand',
'Generic'))) ,
IF ('$(vClientCode)' = 'XXX' ,
If([compound indicator]=2,'Compound',
If([SSG Ind]=SSG,'Single-Source Generic',
If([Drug Indicator]<>Y,'Brand',
'Multi-Source Generic'))))) AS "new column"
IF ('$(vClientCode)' = 'XXX' ,
If([compound code]=2,'Compound',
If([drug type]=4 and [Generic Indicator]=Y,'Generic',
If([drug type]=1 or [drug type]=2 or [drug type]=4 or [drug type]=5,'Brand',
'Generic'))) ,
IF ('$(vClientCode)' = 'XXX' ,
If([compound indicator]=2,'Compound',
If([SSG Ind]=SSG,'Single-Source Generic',
If([Drug Indicator]<>Y,'Brand',
'Multi-Source Generic'))))) AS "new column"
Thank you! I am not able to test this fully yet because other pieces are not built out, but the editor is not turning any of my code red, so I think it's all good.