Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Quite a simple questions i think but i didn't find an answer.
in the load script is is correct to have one IF for multiple THEN?
Test:
NoConcatenate
Load
if(status=6,1,0) as status,
if(status=6,200,300) as revenue,
if(status=6,'Y','N') as cancel_flag
RESIDENT MyTable;
Thank you!
What you have is fine. You shouldn't receive any errors.
What you have is fine. You shouldn't receive any errors.
Yes, this is correct. This is done all the time.
Thanks, Nicole
There is one more
if I put
...
Resident table
where status=6;
does that mean that it first filters only those rows were status=6 and then use it for computation, meaning, I am loosing all other data and can't use PEAK function?
Example:
peak(status) as status // will always return '6', because the source table is filtered PRIOR to LOAD?
resident table
where status=6;
Yes. If you use the where clause, it will only pull in rows where the status is 6. You will not have any other status numbers in your data.