How to get the last row number

Highlighted
Contributor

How to get the last row number

Hi,everyone.

 

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

sample.jpg

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

Could you tell me how to get the number?

 

 

Best regards.

4 REPLIES 4
Highlighted
Master Anaplanner/Community Boss

Re: How to get the last row number

@takushimozuru 

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.

https://help.anaplan.com/anapedia/Content/Calculation_Functions/All/LASTNONBLANK.html

Give that a try.

 

 

 


Jared Dolich
Highlighted
Super Contributor

Re: How to get the last row number

@takushimozuru 

 

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

 

Screenshot_6.png

Screenshot_7.png

 

I hope that helps

 

Thanks

Akhtar

 

Highlighted
Master Anaplanner/Community Boss

Re: How to get the last row number

@takushimozuru 

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.


Jared Dolich
Highlighted
Certified Master Anaplanner

Re: How to get the last row number

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. )