Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There.
Im trying to write an if statement that doesnt seem to be working
I have a field Name
I want to create a new field which defines these Names.
in this field I want Closed,Open and All
I have tried below:
if( Name='Closed','Closed',
If(Name<>'Closed','Active')) as FieldName
This works to get my closed and active steps, how do i get all in the same statement?
FYI :I have many names in this field
Thank You
Can you create one inline and explain the result set as you required. That may helpful to trigger
It seems that you need something like generic field.
If so, try like:
t1:
Load * Inline [
Status
Closed
ABC
BCD
Not Closed
Opennn
];
t2:
Load
'All' as GenericStatus,
Status
Resident t1;
t2:
Load
Status as GenericStatus,
Status
Resident t1 where Status='Closed';
Load
'Open' as GenericStatus,
Status
Resident t1 where Status<>'Closed';
Thank You, an alternative to this is to create 3 buttons with actions on them to select those fields
For this specific case, since 'Open' and 'Closed' are mutually exclusive, you can reduce one load and simplify like:
t1:
Load * Inline [
Status
Closed
ABC
BCD
Not Closed
Opennn
];
t2:
Load
'All' as GenericStatus,
Status
Resident t1;
t2:
Load
If(Status='Closed', Status, 'Open') as GenericStatus,
Status
Resident t1;