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
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';
As I understood from your post,
Any name having 'Closed' word, you want to declare as Closed.
What are the criteria for All and Active?
May be this?
If(Name = 'Closed', 'Closed', If(Name = 'Open', 'Open', 'All')) as FieldName
Hi
Try
if( Name='Closed','Closed','Active') as FieldName
Everything with closed will be closed everything else is still active.
but the user must be able to distinguish between closed active and both by selecting one in a list box...
There is no field defining open names... but the logic is that if it is not closed... then it is open.. or active...
Hi Andrey... what about all though?
If you don't have field name called Name. Then how you are calculating? May be check one funny solution with ValueList() ?? If not i may not understand the rek
FYI - My expression may give make sense if you have field called Name
Sorry i think i havent explained correctly.
The field Name does exist, but there is a name called closed which identifies all closed items all other items will be open hence me using <> to closed in my initial expression... There is no name = 'Open' the logic is that if it is not closed then it is open
Can be more specific. Better with example.
Regards