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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Cross Pollination First Order vs Second Order

Hi,

I have a challenging question (I hope).

I want to check the share of recurring customers how purchase from a new product category on their second purchase.

I have attached some dummy data, which could be read the following way.

Customer A purchased Clothes both on her first and second order, which would mean "No Cross Pollination"

Customer B purchases Electronics both on her first and order, which would mean "No Cross Pollination"

Customer C purchases Books the first time and then Clothes, which would mean "Cross Pollination"

Customer D purchases Clothes the first time and then Books, which would mean "Cross Pollination".

This would mean a result of 50% (2 out of 4 customers) Cross Pollination.

But how would I get this number in QlikView? To make it more complex I would of course have 100000+ customers and 10+categories and you could purchase from several categories already the first time.

Kind regards

Niklas

Labels (1)
3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

This should give you that first 'uncomplicated' number:

=count({<Customer={"=count(distinct Category)>1"}>}DISTINCT Customer)/count(DISTINCT TOTAL Customer)


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi,

I agree that this is the "uncomplicated" number showing share of customers who are purchasing from several categories, but it does not solve the question wether they have switched categories between first and second order.

Neither does it handle the situation when first and second orders are the same, but order three is in a new category.

As a general overview of multi-category purchase share it is still fine.

Kind regards

Niklas

Anonymous
Not applicable
Author

You Need to provide a flag during script

with this script you get at least that second (or third or later on)  that custome rboght a product from other category

you may adapt it to your reequirements

TEST:
LOAD * INLINE [
Customer, Category, Order Rank, Order Id
A, Clothes, 1, 1
B, Electronics, 1, 2
C, Books, 1, 3
D, Clothes, 1, 4
A, Clothes, 2, 5
B, Electronics, 2, 6
C, Clothes, 2, 7
D, Books, 2, 8
]
;

TEST1:
NoConcatenate load *
resident TEST
order by Customer, [Order Rank];

TEST2:
NoConcatenate load
*,
if (Customer=previous(Customer) and Category<>previous(Category),1,0) as ChangeFlag
Resident TEST1;

drop tables TEST, TEST1;