Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have two fields coming in from my Load Script
ASSIGNED_TO and a COMPLETE_BY
Is it possible to add another field to the script based on the two fields above that if ASSIGNED_TO = COMPLETE_BY then it creates a Field called MASTER_USER?
This logic should work for you.
if(len(trim(ASSIGNED_TO)) = 0, 'OPEN', // tests for blank and nulls
if( ASSIGNED_TO = COMPLETE_BY , COMPLETE_BY, 'NONE')) AS MASTER_USER
It is possible, but the method depends on whether the two fields are in the same table.
Can you post an example of your app?
Hello,
You can create that field like: if(ASSIGNED_TO = COMPLETE_BY, 1, 0) as MASTER_USER.
As Colin says, they both have to be in the same table, or you must join both tables.
Hi Colin,
I cant post the data as due to confidentiality but yes the fields are in the same table.
Tim
You can post examples to the community without compromising any data confidentiality by using reduce to make the application smaller and scrambling the data to randomise the data in the application.
Hi Scholar,
Try like this in script:
If both fields are coming from different table then, bring them in on table using resident load or joins and then create this field.
Load
if(ASSIGNED_TO = COMPLETE_BY, 'True','False') as MASTER_USER
from <>
Now in UI in charts use:
if(MASTER_USER='True',MASTER_USER)
Regards
KC
Hi Jose,
Is there anyway to do this where it returns the actual ID (Either the Assigned_To or Complete_By as they should be the same as the Master_USER?
e.g. if Assigned_To and Complete_BY were both A12345 that it returns A12345 as a selectable value in the MASTER_USER Field?
Thanks,
Hi,
yes, try with this one:
if(ASSIGNED_TO = COMPLETE_BY, ASSIGNED_TO, null()) as MASTER_USER.
>Is there anyway to do this where it returns the actual ID
if(ASSIGNED_TO = COMPLETE_BY, ASSIGNED_TO) as MASTER_USER
Hi Colin,
Firstly apologies, for what I had originally asked the above is spot on and would be correct. However I have found a flaw my end that ASSIGNED_TO can actually be blank. instead of ASSIGNED_TO=COMPLETE_BY, is there anyway I can merge the two fields to form MASTER_USER.
To explain what I am trying to achieve so you can make more sense of it. I am working on a report in relation to the number of projects being completed.
I want to show Projects that are OPEN(UNASSIGNED), ASSIGNED_TO AND COMPLETE BY.
As Assigned by and Complete by can be different I was hoping to create a joint field so I could use it as a Dimension.
For Instance I want something like:
Master User | ASSIGNED_TO (Count Expression where ASSIGNED_TO = 'Scholar' | COMPLETE (Count Expression where COMPLETE_BY = 'Scholar) |
Scholar | 15 | 107 |
I hope that makes more sense,