Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bimanbeginner
Contributor II
Contributor II

If statement

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

13 Replies
Anil_Babu_Samineni

Can you create one inline and explain the result set as you required. That may helpful to trigger

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresesco
MVP
MVP

It seems that you need something like generic field.

Untitled.png

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';

bimanbeginner
Contributor II
Contributor II
Author

Thank You, an alternative to this is to create 3 buttons with actions on them to select those fields

tresesco
MVP
MVP

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;