Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want this but i got a crazy zero
If(SmpPillar='Corrective Maintenance','Corrective Workorders' and not(SmpPillar) = 'Corrective Maintenance','Preventive Workorders' ) as NewStatus
I got a zero instead of the text "Corrective Workorders"
It is not clear what you are trying to do. Perhaps if you show some data and expected output that would help.
In the meantime - your current statement:
If(SmpPillar='Corrective Maintenance','Corrective Workorders' and not(SmpPillar) = 'Corrective Maintenance','Preventive Workorders' ) as NewStatus
SmpPillar appears to be text, so not(SmpPillar) makes no sense.
If(SmpPillar='Corrective Maintenance', // this is your condition to be evaluated as T/F
'Corrective Workorders' and not(SmpPillar) = 'Corrective Maintenance', // this is NOT a single value
'Preventive Workorders' ) as NewStatus
Also - True/False values and integers: The value of True() is -1, yes minus one.
If you are wanting to nest the IF, that could work.
Are you trying to do something like this:
If(SmpPillar='Corrective Maintenance','Corrective Workorders','Preventive Workorders' ) as NewStatus
Would a simple wildmatch be a better choice?
If(Wildmatch(SmpPillar, 'corrective*'), 'Corrective Workorders', 'Preventative Workorders') as NewStatus
-ws
Hi,
not understood.
Could the problem be here?
There does not seem to be a value specified if the condition is false, so I am not sure what you are trying to do here. Also what is SmpPillar? Is it a logical value?
-ws
If(SmpPillar='Corrective Maintenance','Corrective Workorders' and not(SmpPillar) = 'Corrective Maintenance','Preventive Workorders' ) as NewStatus
Your condition is in red. Your true value is in purple, and it can only result in 0 or 1 since it's a logical condition. Your false value, in blue, looks fine. Presumably, you meant for the true value to be something other than a logical condition?
It is not clear what you are trying to do. Perhaps if you show some data and expected output that would help.
In the meantime - your current statement:
If(SmpPillar='Corrective Maintenance','Corrective Workorders' and not(SmpPillar) = 'Corrective Maintenance','Preventive Workorders' ) as NewStatus
SmpPillar appears to be text, so not(SmpPillar) makes no sense.
If(SmpPillar='Corrective Maintenance', // this is your condition to be evaluated as T/F
'Corrective Workorders' and not(SmpPillar) = 'Corrective Maintenance', // this is NOT a single value
'Preventive Workorders' ) as NewStatus
Also - True/False values and integers: The value of True() is -1, yes minus one.
If you are wanting to nest the IF, that could work.
Are you trying to do something like this:
If(SmpPillar='Corrective Maintenance','Corrective Workorders','Preventive Workorders' ) as NewStatus
Would a simple wildmatch be a better choice?
If(Wildmatch(SmpPillar, 'corrective*'), 'Corrective Workorders', 'Preventative Workorders') as NewStatus
-ws
Thank you . Wildmatch did the trick!!