# App Development

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for
Did you mean:
Contributor

## Set analysis -- Priority

Hi,

Considers there are 3  Plans  that a mobile users can buy from Telecom operator :

Plan 1 : Monthly Plan - (Priority 1)

Plan 2 : Weekly Plan - (Priority 2)

Plan 3 : Daily Plan - (Priority 3)

Consider the Following mobile users buy the below mentioned Plans according

Mobile user 1 : Monthly plan, Weekly Plan and Daily Plan

Mobile user  2 : Monthly plan, Weekly Plan

Mobile user 3:  Weekly Plan and Daily Plan

Mobile user 4 : Monthly plan, Weekly Plan and Daily Plan

Mobile user 5  :  Daily Plan

I want to find count of mobile users in  monthly plan , weekly plan and Daily plan respectively.

Mobile User1 should be considered as  Monthly plan user even though he has also bought Weekly plan and Daily plan  because Monthly Plan is higher priority

Mobile users 2 and Mobile User 3 are to be considered as Weekly Plan user even though they have bought Daily plan becasue Weekly plan is of Higher priority

So total subscibers  in each plan should be

Monthy Plan : 3

Weekly Plan  : 1

Daily plan : 1

----------------------------

total : 5

Labels (1)
• ### Set Analysis

1 Solution

Accepted Solutions
MVP

HI @Vivetha

Try like below

Table2:
Load *, Pick(Match(Mobile_plan, 'Monthly_Plan', 'Weekly_Plan','Daily_Plan'),1,2,3) as PlanNum Inline [
Mobile_user ,Mobile_plan
1 , Monthly_Plan
1 ,Weekly_Plan
2 ,Monthly_Plan
2,Weekly_Plan
3 ,Monthly_Plan
3,Weekly_Plan
4 ,Monthly_Plan
4,Weekly_Plan
5 ,Monthly_Plan
5,Weekly_Plan
6 ,Monthly_Plan
7 ,Monthly_Plan
8 ,Monthly_Plan
9 ,Monthly_Plan
10, Monthly_Plan
11 ,Daily_Plan
12,Weekly_Plan
11 ,Weekly_Plan
13,Daily_Plan
];
Join
Load Mobile_user, Min(PlanNum) as PlanNum, 1 as flag Resident Table2
Group by Mobile_user;

Front end:

dim: Mobile_plan

exp: Count({<flag={1}>}Distinct Mobile_user)

Hope it helps

Thanks & Regards,
Mayil Vahanan R
4 Replies
MVP

How is your data structure? Do you have a priority field in the model? Try to share a sample data set to work on.

Contributor
Author

Hi , The priority field is not available in the model

Mobile_user ,Mobile_plan
1 , Monthly_Plan
1 ,Weekly_Plan
2 ,Monthly_Plan
2,Weekly_Plan
3 ,Monthly_Plan
3,Weekly_Plan
4 ,Monthly_Plan
4,Weekly_Plan
5 ,Monthly_Plan
5,Weekly_Plan
6 ,Monthly_Plan
7 ,Monthly_Plan
8 ,Monthly_Plan
9 ,Monthly_Plan
10, Monthly_Plan
11 ,Daily_Plan
12,Weekly_Plan
11 ,Weekly_Plan
13,Daily_Plan
];

Regards

MVP

HI @Vivetha

Try like below

Table2:
Load *, Pick(Match(Mobile_plan, 'Monthly_Plan', 'Weekly_Plan','Daily_Plan'),1,2,3) as PlanNum Inline [
Mobile_user ,Mobile_plan
1 , Monthly_Plan
1 ,Weekly_Plan
2 ,Monthly_Plan
2,Weekly_Plan
3 ,Monthly_Plan
3,Weekly_Plan
4 ,Monthly_Plan
4,Weekly_Plan
5 ,Monthly_Plan
5,Weekly_Plan
6 ,Monthly_Plan
7 ,Monthly_Plan
8 ,Monthly_Plan
9 ,Monthly_Plan
10, Monthly_Plan
11 ,Daily_Plan
12,Weekly_Plan
11 ,Weekly_Plan
13,Daily_Plan
];
Join
Load Mobile_user, Min(PlanNum) as PlanNum, 1 as flag Resident Table2
Group by Mobile_user;

Front end:

dim: Mobile_plan

exp: Count({<flag={1}>}Distinct Mobile_user)

Hope it helps

Thanks & Regards,
Mayil Vahanan R
Contributor
Author

thank you @MayilVahanan

Tags
Community Browser