Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

script ordercount

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.

4 Replies
tresesco
MVP
MVP

How is the Ordercount  for yyy is 1?

Not applicable
Author

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.

anbu1984
Master III
Master III

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;

tresesco
MVP
MVP

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