Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I am working on some advance analysis and not sure how to get this done in qliksense. I am working to get the no of customers who moved or shifted from Service S1 to S2 and ViceVersa.
My dataset has these relevant fields ClientName, DateofOrder and Service(Containing S1 or S2) as posted in the photo.
For this analysis I want to take the last order date of respective services by a particular client, from this example what I want is :
No of clients from S1 to S2 : 2 (JKL as his last S1 order was on 3/19/2019 and S2 order was on 3/26/2019 so he moved to S1 to S2 and similarly for XYZ, Please NOTE ABC will not be counted because of the last order date of respective services)
No of clients from S2 to S1 : 2 (ABC as his last S1 order was on 3/21/2019 and S2 order was on 3/15/2019 so he moved to S2 to S1 and similarly for PQR, Please NOTE JKL will not be counted because of the last order date of respective services)
I am not sure how to start with this analysis, Please help me out.
Asking for your help again @sunny_talwar
Thank You
Try to adapt it to what u have :
urTable:
load ClientName, date(date#( DateofOrder0,'M/DD/YYYY'),'M/D/YYYY') as DateofOrder,Service
Inline [
ClientName, DateofOrder0,Service
ABC ,3/14/2019, s1
ABC,3/15/2019,s2
PQR,3/16/2019,s2
PQR,3/17/2019,s1
JKL,3/18/2019,s2
JKL,3/19/2019,s1
GHI,3/20/2019,s2
ABC,3/21/2019,s1
PQR,3/22/2019,s1
XYZ,3/23/2019,s2
XYZ,3/24/2019,s1
XYZ,3/25/2019,s1
JKL,3/26/2019,s2
];
left Join(urTable)
load ClientName , date(max(DateofOrder),'M/D/YYYY') as MaxDateS1 Resident urTable Where Service='s1' Group by ClientName;
left Join(urTable)
load ClientName , date(max(DateofOrder),'M/D/YYYY') as MaxDateS2 Resident urTable Where Service='s2' Group by ClientName;
NoConcatenate
load ClientName,DateofOrder,Service, if(MaxDateS1>MaxDateS2,'S2 to S1','S1 to S2') as Behaviour Resident urTable;
Drop Table urTable;
result
Try to adapt it to what u have :
urTable:
load ClientName, date(date#( DateofOrder0,'M/DD/YYYY'),'M/D/YYYY') as DateofOrder,Service
Inline [
ClientName, DateofOrder0,Service
ABC ,3/14/2019, s1
ABC,3/15/2019,s2
PQR,3/16/2019,s2
PQR,3/17/2019,s1
JKL,3/18/2019,s2
JKL,3/19/2019,s1
GHI,3/20/2019,s2
ABC,3/21/2019,s1
PQR,3/22/2019,s1
XYZ,3/23/2019,s2
XYZ,3/24/2019,s1
XYZ,3/25/2019,s1
JKL,3/26/2019,s2
];
left Join(urTable)
load ClientName , date(max(DateofOrder),'M/D/YYYY') as MaxDateS1 Resident urTable Where Service='s1' Group by ClientName;
left Join(urTable)
load ClientName , date(max(DateofOrder),'M/D/YYYY') as MaxDateS2 Resident urTable Where Service='s2' Group by ClientName;
NoConcatenate
load ClientName,DateofOrder,Service, if(MaxDateS1>MaxDateS2,'S2 to S1','S1 to S2') as Behaviour Resident urTable;
Drop Table urTable;
result
Where exactly are you looking to view this information in a chart or do you just need the count in a kpi object?
I just need the Count of KPI as how many moved from S1 to S2 and another KPI for Count of People from S2 to S1.
Have u taken 2 seconds to read my response?..