Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
CustomerID | Subscription |
1 | A |
1 | B |
1 | C |
1 | D |
2 | B |
3 | B |
3 | C |
4 | A |
5 | D |
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:
nº | |
Premium | 2 |
Free | 3 |
TOTAL | 5 |
But what I am obtainig in QV is the following:
QV | |
Premium | 3 |
Free | 3 |
TOTAL | 5 |
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!
it's difficult to explain better than here