Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I m writing very simple if condition and strange its not working,,pls suggest
if((GL_CC_Flag=1 and (Cost_Center)= 'NA' ), Cost_Center=19001,0) as TestCenter;
i want where if((GL_CC_Flag=1 and (Cost_Center)= 'NA' ), will true cost centre will feed as 19001
when i m doing below for testing its working means giving output 1 but in above giving output 0
if((GL_CC_Flag=1 and (Cost_Center)= 'NA' ), 1,0) as TestCenter;
pls suggest
Try this:
If(GL_CC_Flag = 1 and Cost_Center = 'NA', '19001,0', Cost_Center) as Cost_Center;
How can you assign Cost_Center=19001? Will this work?
try like this?
if((GL_CC_Flag=1 and Cost_Center= 'NA' ), 19001,Cost_Center) as Cost_Center;
even not working
what error you are getting?
Sample?
The conditions are diferents;
Tell us what do you want to do?
It is a very thin error. Asing:: Cost_Center=19001, in fact, it could be on another script, Cost_Center=0.
It is true?
No error still getting NA
Do you want to assign 190001 to TestCenter when both conditions are true? If yes, then I think below should work.
if(GL_CC_Flag=1 and Cost_Center= 'NA',19001,0) as TestCenter
try this?
if(GL_CC_Flag=1 ,
if(Cost_Center= 'NA', '19001')) as Cost_Center
Do you are sure that the condition are true? Is it fullied?