Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi have the following data below..
Reference | Account No | Type | ACT | PL | If(ACT<PL,'Yes','No) | |
24356 | 11709992 | ACT | 3545.44 | 0 | ? | |
24356 | 11709992 | PL | 0 | 8745.44 | ||
24359 | 11709992 | ACT | 4486.99 | 0 | ||
24359 | 11709992 | PL | 0 | 1220.88 | ||
24345 | 11709992 | PL | 0 | 5567.87 | ||
24345 | 11709992 | ACT | 9874.55 | 0 | ||
Reference | Account No | ACT | PL | If(ACT<PL,'Yes','No) | ||
24356 | 11709992 | 3545.44 | 8745.44 | ? | ||
24359 | 11709992 | 4486.99 | 1220.88 | |||
24345 | 11709992 | 9874.55 | 5567.87 | |||
When Iam trying to make | If(ACT<PL,'Yes','No) | it does not consider 3545 < 8745 rather it takes 3545.44 < 0. |
you need to combine act and pl rows into a single row
try with script like this.
tempmaintable:
load Reference,AccountNo,ACT
from yoursource
where Type='ACT'
;
outer join (tempmaintable)
load Reference,AccountNo,PL
from yoursource
where Type='PL'
;
maintable:
load *
, If(ACT<PL,'Yes','No) as PlGreaterFlag
resident
tempmaintable;
drop table tempmaintable;