I am working on requirement where the calculation involves a multiplier to be applied on previous years based on year for which it is calculated. Please see screenshot below.
I want to achieve the result in B to be dynamic, so it can be calculated until whichever year user decides it needs to stop. Currently I have achieved this by manual multiplier & Select function on Year to offset, but this is limited to years based on offset I define in formula.
Please advise, if there is a way to make this dynamic.
Thanks
Page 1 / 1
Hi @Apurv ,
A possible solution to achieve your goal is to create a technical dimension that helps simulate the loop logic. Here's a detailed step-by-step breakdown:
Step 1: Create a Technical Dimension
Start by creating a dimension (e.g., ID10) that has the same number of items as your Year dimension. This will be used to simulate the loop.
Define the following properties:
Name: Integer — generated automatically by Pigment.
Reverse ID: Integer — calculated with this formula:
ID10.Name1REMOVE MAX: ID10] - ID10.Name + 1
This flips the rank of each item to get the reverse order.
ID10 dimension
Step 2: Create a Matching Metric (Rank A)
Build a metric Rank A (data type: dimension ID10) that maps each Year item to a corresponding item in the ID10 dimension using the following formula: