Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
how to calculate customer count who are available in current and previous month only in load script.
Attached test file
As below
Main:
load customerID
,Date#(Date,'MM/DD/YYYY') as cDate
,customerID&monthname(Date#(Date,'MM/DD/YYYY')) as cust_key
,customerID&monthname(Date#(Date,'MM/DD/YYYY'),-1) as prev_m_cust_key
inline
[
customerID,Date
c1,03/18/2022
c2,03/25/2022
c3,03/01/2022
c1,04/25/2022
c2,04/25/2022
c4,04/25/2022
c6,05/25/2022
c5,03/18/2022
c1,02/21/2022
];
Link:
load cust_key as cust_key, MonthName(cDate) as Month
Resident Main;
load prev_m_cust_key as cust_key,MonthName(cDate) as Month
Resident Main;
drop field prev_m_cust_key;
exit Script;
thanks vineeth working perfect, could you pls help me on couple of items
customers of those available in current month but not in previous month
customers of those available in previous month but not in current month