Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My logic is not working. I am not sure why
What I am expecting to see is 2 records in the autopay table, but I am only seeing 1 (from the currentrecord table) I am trying to use AutoKey and the value to compare against.
AutoPayCustomersDB:
LOAD
1 as t
,LastCustKey
,RecDate
,AutoKey
,CustKey
,PKID
,UnitsID
,CustomerID
,DateStart
,DateEnd
,AutoPay
,AutoPayID
,AutoPayInfo
,CSRentalID
,AutopayON
,AutopayOFF
Resident CurrentRecord;
Concatenate (AutoPayCustomersDB)
Load *
Where NOT ( Exists(AutoKey, AutoKey))
;
Load
'$(vDate)' as RecDate
,CustomerID&UnitsID&'-'&fabs(AutoPay) as AutoKey
,AutoPay
,if (AutoPay = -1, 1,0) as AutopayON
,if (AutoPay <> -1, 1,0) as AutopayOFF
,CustomerID&UnitsID as CustKey
,CustomerID&UnitsID&'-'&'$(vDateNum)' as LastCustKey
,PKID
,UnitsID
,CustomerID
,DateStart
,DateEnd
,AutoPayID
,AutoPayInfo
,CSRentalID
Where NOT ( Exists(AutoKey, AutoKey))
If you use the above code, it eliminate the duplicate population of the row for AutoKey. If there are two rows with same AutoKey, only the first loaded will be there.
I have the not exist logic, but it is not getting any new rows. And I know that there should be