Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
SDT
Creator
Creator

Master Dimension for Quadrant Analysis

Hello,

I have a data set with a range of customers and a range of products along with other measures and dimensions.

I have classified a subset of customers as either "A" or "B" and a subset of products as "A" or "B".

Products and customers are related to each other on orders. 

I need to classify all combinations of customer and products (only when both have an A or B) into quadrants:

AA

AB

BA

BB

I tried several versions of a master measure and am getting results where the quadrant contains only one letter.

Here is one example I tried:

AGGR({1<CustomerAB={'A','B'}, ProductAB={'A','B'}>}
DISTINCT CustomerAB&ProductAB, Customer,Product)

I need to be able to set the quadrant regardless of other selections (hence the 1<> set analysis). The definitions of A or B are done in the load script independently for customer and for product.

 

Any help would be greatly appreciated.

 

Labels (1)
1 Solution

Accepted Solutions
jbhappysocks
Creator II
Creator II

Hi, maybe there is an easier way to do it, but I think adding Only to your Aggr should do it?

 

AGGR({1<CustomerAB={'A','B'}, ProductAB={'A','B'}>}
DISTINCT Only(CustomerAB)&Only(ProductAB), Customer,Product)

View solution in original post

3 Replies
sidhiq91
Specialist II
Specialist II

@SDT  Could you please post some sample data and expected output? that way it will help us to understand better and come up with a solution.

jbhappysocks
Creator II
Creator II

Hi, maybe there is an easier way to do it, but I think adding Only to your Aggr should do it?

 

AGGR({1<CustomerAB={'A','B'}, ProductAB={'A','B'}>}
DISTINCT Only(CustomerAB)&Only(ProductAB), Customer,Product)

SDT
Creator
Creator
Author

That did it @jbhappysocks !

 

Thank you.