Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to load SalesREP ID whose current sales value for the current month is >0, but for last 8 years's sales value will be 0.
So I have written the below code in script:
[TmpSalesRep]:
first 2
load
[%Sales Trn Key],
[Process Date] as DateKey,
[Sales Amount USD] as SalesAmount,
[Sales Rep ID] as AsOfSalesRepID
resident [TmpTable]
where
[Process Month] = 'March' and [Sales Amount USD]>0;
left join
load
[%Sales Trn Key],
[Process Date] as DateKey,
[Sales Amount USD] as SalesAmount,
[Sales Rep ID] as AsOfSalesRepID
resident [TmpTable]
where
[Process Date] >= '$(vPrevEightYearStartDate)' and
[Process Date] <= '$(vPrevYearEndDate)' and
[Sales Amount USD]>=0;
//$(vCurrentMonth)
drop table [TmpTable];
Please let me know if I am wrong because I am getting wrong data.
Check link below.
Regards,
Kaushik Solanki
Hi Sandip,
instead of left join try to use concatenate.
BR
Martin