Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
ms_12
Partner - Contributor III
Partner - Contributor III

Expression to count distinct stores for multiple condition

Hi All,

I have below dataset. I want to find the distinct count of store where Type ='Local' and Sub Type='Apples' & 'Pears'. I this case distinct count will be 2 (Store 'A' & 'D'). I need set analysis expression to achieve the same.

Store Type Sub Type
A Local Apples
A Local Pears
A Export Bananas
A Export Pineapples
B Local Apples
B Export Pears
B Export Coconuts
C Local Grapes
C Export Apples
C Export Pears
D Local Apples
D Local Pears
D Local Grapes
D Export Pineapples
Labels (4)
1 Solution

Accepted Solutions
Kushal_Chawda

@ms_12  try below

=count(distinct {<Store=p({<Type={'Local'},[Sub Type]={'Apples'}>})*p({<Type={'Local'},[Sub Type]={'Pears'}>})>} Store)

View solution in original post

1 Reply
Kushal_Chawda

@ms_12  try below

=count(distinct {<Store=p({<Type={'Local'},[Sub Type]={'Apples'}>})*p({<Type={'Local'},[Sub Type]={'Pears'}>})>} Store)