Please go through the attached file.
here each userid has a plan and start /end date of each plan. User can upgrade/downgrade their plan. here i m looking at the solution where i can identify which is the latest plan for unique userId to consider them for the pricing.
Ex : User1 has A plan . after that he has upgraded to C plan. I want to identify that this is the latest plan to the current month.
Please help me with this.
Try this out.
What was given (I used Row as the "row dimension" as none was given):
In the above, the User and Plans line items are list formatted line items where Plans has a Top Level Item defined (All Plans).
Create a module that is dimensionalized by Users (I call it People) and Plans with 3 line items: Start Date, End Date, and Plans Item.
The formulas are:
Set the Summary of the line items to be:
Create the Results module dimensionalized by People (users in the first picture) with Plan, Start Date, and End Date as line items.
Hope this helps,
While that will work, it relies on an aciton which could lead to concurrency issues. Also, this will create a debug log as the action will not have green checks (clean load). Lastly, for the information to be updated, you will have to run this action, so the perferred way should be using formula's (less concurrency issues).
@rob_marshall's approach is a really good one. See below for another approach you could take:
This is a really great opportunity to use the power of saved views and sorting. What I would do to solve this problem is the following:
As always, there's loads more that you can do to make the process more efficient, but this is the basic premise. See attached images for the results!
Hope this helps,
I think it is needed a basic assumption: the "Valid From", "Valid To" intervals, for the same user, cannot have days in common, otherwise for the common days you can have "valid" in the same time 2 "Plan", which I do not think it is the case.
Based on the above assumption and considering that the current month can be considered as a "Current Date" defined in a general module as parameter you can have this solution:
- Current Date is Apr 12th 2018 in the module DP01
- Import all data in a numbered list in the module OP01
- formula "Current Plan" in OP01:
IF 'DP01. Paremters'.Current Date >= Valid From AND 'DP01. Paremters'.Current Date < Valid To THEN Plan ELSE BLANK
- Formula of "Current Plan" in OP02
'OP01. ALL Data'.Current Plan[FIRSTNONBLANK: 'OP01. ALL Data'.User Id]
Below a print-screen with the results presented in a dashboard:
Let me know if this is what you wanted