Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm a newbie with Qlikview. We want to count orders, but for one customer we have to count the total orders per day as 1 order. So how can I create a ordercounter in the script where for this customer the total of orders on the same day are counted as 1 and for other customers one order is one order?
Data:
Customer Date Ordernumber
xxx 21-10-2014 1234
xxx 21-10-2014 5678
yyy 21-10-2014 9876
yyy 21-10-2014 8765
I want a table in Qlikview:
Customer Date Ordernumber Ordercounter
xxx 21-10-2014 1234 0.5
xxx 21-10-2014 5678 0.5
yyy 21-10-2014 9876 1.0
yyy 21-10-2014 8765 1.0
Thx.
How is the Ordercount for yyy is 1?
Only for customer xxx i want to count the orders on one day as total 1 and for the other customers one order is 1 in the ordercounter.
Tbl:
LOAD * Inline [
Customer,Date,Ordernumber
xxx,21-10-2014,1234
xxx,21-10-2014,5678
yyy,21-10-2014,9876
yyy,21-10-2014,8765 ];
Join
Load Customer,If(Customer='xxx', Count(DISTINCT Customer)/Sum(1),1) Resident Tbl Group By Customer,Date;
Input:
Load
Customer,
Date(Date) as Date,
Ordernumber
Inline [
Customer,Date,Ordernumber
xxx,41933,1234
xxx,41933,5678
yyy,41933,9876
yyy,41933,8765
];
Join
OutPut:
Load
Customer,
Date,
If(Customer='xxx', 1/Count(Ordernumber), 1) as OrderCount
Resident Input Group By Customer, Date;
PFA