Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to make a dimension avoiding some columns?

Hello everybody, i am new here in the community but i am not new in QV, but I have found an issue I dont know how to solve it.

I have something like that:

  

CustomerIDSubscription
1A
1B
1C
1D
2B
3B
3C
4A
5D

And what I want to do is to count the customers by their subscription. There are 4 types of subscription (A, B, C and D) but I really want to separate them by: PremiumSubscription and FreeSubscription.

FreeSubscription is B. And that means that if a customer has 4 subscriptions and within them is the subscription B, the customer has a FreeSubscription. And of course, if he only has B subscription, it has FreeSubscription.


On the other hand, if a customer doesnt have B subscription, he will have a  PremiumSubscription.


So, the result I would like to have is the shown below:

  

Premium2
Free3
TOTAL5

But what I am obtainig in QV is the following:

  

QV
Premium3
Free3
TOTAL5

I am doing this:

1) Calculated dimension: =If(subscription='B', 'Free', 'Premium') <-- THE PROBLEM IS CLEARLY HERE

2) Expression: =count(DISTINCT CustomerID)

The problem is the dimension, cause I am counting a customer as Premium even if he has B subscription, and customer with more than one subscription containig B should be only in FreeSubscription.

I hope I have explained my problem well, and you can help me!

Thanks a lot!

10 Replies
maxgro
MVP
MVP

it's difficult to explain better than here

ValueList() – For those tricky situations