Model Building
Hello,
I have one requirement where line items should be filtered based on the Year(FY24, FY25) Dimension. For eg: there are 12 line items, which contains both text and number formats. If User selects FY 24, The first 6 line items should be shown in the page and if user selects FY25, last 6 line items should be shown . Any suggestions.
Thanks.
Best Answer
-
Hi @lokeshm ,
Because of the mix of text and number formatted lineitems here, lineitem subset is not an option. Based on my two assumptions, you might want to try below approach:
Assumption1: All 12 lineitems are reporting lineitems and not any input ones,
Assumption2: Dimensionality of the 12 lineitems are the same
Approach: Convert 12 lineitems into a list (just add those lineitems into a new list), and create a filtering logic to filter respective list items based on user selection of the year.
In a different reporting module dimensioned by this new list, create a text formatted lineitem where you would fetch values from the original 12 lineitems, for each of the list item by using if-then-else checks (at this step, the deisgn gets little dirty). As you might have noticed, even the number formatted values are converted into text format at this step, since we have only one lineitem of text format, against the new list of 12 items that represent both number and text formatted values.
Drawbacks in this approach:
1. Not easily scalable. If you have more lineitems to add in future, you need to add them to the list and modify the filtering logic accordingly
2. Only reporting purpose. You can't apply this logic if there is any input lineitem in the mix
3. If dimensionality of any of the source lineitems is way different, you may have to struggle to convert it to align with that of rest of the lineitems
Another approach (if the names of each of the 6 lineitems can be static) is to use one set of 6 reporting lineitems, and change reference data in those lineitems based on user selection of the year. That way, you won't be filtering lineitems on the UX, but will be managing underlying data shown in those 6 lineitems with simple if-then-else checks.
Hope these help in case you end-up finding no other better alternate.
Cheers!1