"is first occurence" gives me unwanted output. cant find a solution


Hello guys,


my colleagues plan on IDs. After they are finished with their planning I want to build a profit and loss hirarchy by creating codes based on different inputs.

Those codes have to be imported into a list. The problem I am facing now, is that they can plan totally different topics on the same ID in the next forecast. That's why the same code now appears on another ID. The isfirstoccurence formula shows me true, if the exact same code appears somewhere else in another version (HR1, HR2, HR3 are Forecast 1, Forecast 2, etc.)


As you can see in the screenshot, I want the isfirstoccurence to check my column "3.4 ...." the exact same code gives me a true result although I only want true once. I am importing that column into a new list and get the error that this key has already been processed. It seems to be caused by appearing on a new a different ID in another version (once HR3 and once HR1)

How can I combine First Occurence for the list (PV_14, PV_15, .... ) on which my source module is dimensioned on as well as Versions? Any Ideas ?







Best Answer

  • a.dilieto
    Answer ✓



    I think this occurs because you are using the native Versions, which results in the RANK being reset for each Version.

    You might consider to switch to a fake Version list with a mapping from the native Versions.

    Instead, in case "3.4 Kostenart L4 Code" does not depend on the Versions, you could reference one single version through a boolean that is TRUE for only one version and add this condition to the final check.





  • Hi Dalim,

    you could try creating an additional numeric line item "RANK ID" with formula: RANK(1, ASCENDING, SEQUENTIAL, TRUE,'3.4 Kostenart L4 code') and then in the "FO L4 Code" line item apply the formula: RANK ID = 1


    Hope this helps!



  • Or, directly in "FO L4 Code": RANK(1, ASCENDING, SEQUENTIAL, TRUE,'3.4 Kostenart L4 code')=1

  • first of all thanks for looking at my problem !


    unfortunately Anaplan ist starting to count at 1 for every version that I have (in this case HR1 and HR3).


    Anaplan Forum2.JPG



  • You the man! Thanks a lot !


    I had to adjust a little bit in order to make it work, but the combination of rank formula and a dummy version list instead of native versions brought me the right result.


    Can I just ask you another question?


    I do not really understand the rank formula the way you told me to use it.


    --  Reminder : RANK(1, DESCENDING, SEQUENTIAL, TRUE, '3.4 Kostenart L4 Code') --


    In the position of number "1" there is supposed to be the source item to rank. So why does it work ?

    Is it ranking the number 1 for the whole module ? And then because in the end I type '3.4 Kostenart L4 Code' it is using all the same codes as a subgroup and then because I type sequential it resolves all draws (because a 1 everywhere is a draw everywhere) into the order they occur ?




  • Spoiler