Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I currently have the below table and code in my script:
Load
if(A='Y',if(B='Y', 'Collaterally Held', 'Held'),if(IsNull(C),'Not Held & Never Held', 'Not Held & Has Been Held')) as [Held State]
A | B | C |
---|---|---|
Y | Y | 12/08/2015 |
Y | Y | 12/08/2015 |
Y | Y | 12/08/2015 |
Y | N | 12/08/2015 |
Y | N | 12/08/2015 |
N | N | 12/08/2015 |
N | N | |
N | N | |
N | N | |
N | N |
This creates a nice bar chart as follows:
So it's Collaterally Held when A is 'Y' and B is 'Y', and Held when A is 'Y' and B is 'N'. However I want the following change:
Held should be just when A is 'Y'. So everything would be the same, except Held would now have a value of '5'.
I haven't been able to get this to work so far. The 3rd and 4th columns work fine.
Any help would be much appreciated.
Kind regards,
Tristan
May be this:
Table:
Load *,
if(A='Y', 'Held', if(IsNull(C),'Not Held & Never Held', 'Not Held & Has Been Held')) as [Held State]
FROM source;
Concatenate (Table)
Load *,
'Collaterally Held' as [Held State]
FROM source
Where A = 'Y' and B = 'Y';
Seems like you don't want Collaterally Held anymore? If that's true, try this:
Load
if(A='Y',if(B='Y', 'Held', 'Held'),if(IsNull(C),'Not Held & Never Held', 'Not Held & Has Been Held')) as [Held State]
Or this:
Load
if(A='Y','Held', if(IsNull(C),'Not Held & Never Held', 'Not Held & Has Been Held')) as [Held State]
Hi Sunny,
Thanks for the response!
I would still like Collaterally Held if possible. So the same four columns as shown, but with Held as just when A is 'Y'.
One row will only be able to take one value for a particular columne, either Collaterally Held or Held. May be add extra rows when A ='Y' and B = 'Y' as Held.
May be this:
Table:
Load *,
if(A='Y', 'Held', if(IsNull(C),'Not Held & Never Held', 'Not Held & Has Been Held')) as [Held State]
FROM source;
Concatenate (Table)
Load *,
'Collaterally Held' as [Held State]
FROM source
Where A = 'Y' and B = 'Y';