Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
k25853004
Contributor
Contributor

Customers count of those both current and previous month in qliksense load script

Hi All, 

how to calculate customer count who are available in current and previous month only in load script.

Attached test file

Labels (1)
2 Replies
vinieme12
Champion III
Champion III

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;

 

qlikCommunity1.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
k25853004
Contributor
Contributor
Author

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