Reputation: 1
I have a situation wherein I want to count the distinct customer.in a table with a condition per product. I want a summary count of distinct customers per product.
I created a parameter which shows what I want to be included and what should not be counted. The rules applied on the status are written below:
IF ATTR([Product]) = 'A' AND COUNT([Record]) >= 10 THEN 'Should be counted'
ELSEIF ATTR([Product]) = 'B' AND COUNT([Record]) >= 5 THEN 'Should be counted'
ELSEIF ATTR([Product]) = 'C' AND COUNT([Record]) >= 3 THEN 'Should be counted'
ELSE 'Should not be counted'
END
Since the data is transaction per row. Think of record as purchases. I am only interested in the right side of the crosstab CountD column. Please refer to the image below.
How can I achieve a summary using distinct customers per product considering only repeat purchases for product A >=10, product B>=5 and product C>=3.. If I remove the customer name everything will be aggregated and undesirable.
I want my output to be like the one below.
Any help will be so much appreciated. Can someone share/teach me the steps to achieve the kind of output that I desire.
Thank you in advance
Joseph
Upvotes: 0
Views: 428
Reputation: 26218
Though it would have been better if you'd shared the data structure, yet I think the following calculated field may help
{FIXED [Product] : COUNTD([CUSTOMER])}
Needless to say, If you want counting of filtered records, you should include [STATUS]
field on filters shelf and Add to Context
after right clicking it in the filters shelf itself (because order of operations of LOD calculations is higher than normal filters but lower than context filters)
Upvotes: 0