How to get the last row number




How do I get the last row number of a line item with characters entered?


I would like to get row number "5" from this module.

Could you tell me how to get the number?



Best regards.

Best Answer

  • Akhtar.shahbaz



    You can achieve this by adding two line items, below are the screenshot for you reference.





    I hope that helps






  • @taku.s 

    Create a line item that concatenates Item A, Item B, Item C and Date (although date should probably be dimensionalized)

    then use the LASTNONBLANK function.

    Give that a try.




  • @taku.s 

    I really like @Akhtar.shahbaz answer to find row 5. That's a solid solution.


    But, as i thought more about this scenario I couldn't help but wonder what is the use case.

    It looks like you're loading a transaction module using sequential numbers and wanting to delete the rows with no transactions.

    If that's the case, I'd like to add a few thoughts.


    First, try to avoid using sequential numbers to load transactions. While this may seem like a convenient way to load data it will cause a lot of issues later when you try to update the transations, append, or need to remove certain transactions. Read @rob_marshall post on Data Hub Peak Performance. I promise this will be one of the best posts you've ever read regarding transaction modules.


    Secondly, if you really must use sequential numbers I would recommend setting a Boolean that finds the empty rows. Then use that Boolean to "Delete from List using selection" in the action tab. Much easier than searching for the first row.

  • By the way, I think your question is normal when you use excel. When you're in Anaplan, it could be slightly different.


    Excel has one row with two statuses, having data or a blank.
    Anaplan row is (should be) determined with two statuses that exist or not.
    You ought to keep every row has some meaning to exist, or don't generate a vacant row.
    If you get some new data, add rows (items) as many as you need.



    (...Sorry that I am far from your question. )