Skip to main content
1-Visitor
January 27, 2022
Solved

How to get Last N Rows of any Infotable

  • January 27, 2022
  • 1 reply
  • 4866 views

Hi Team,

 

Just like to get N no of rows from top in any infotable ThingWorx provides default snippet as TopN method of InfotableFunctions , do we have any snippet to get Last N rows of any infotable?

 

Please share the snippet.

 

Thanks in advance.

Best answer by RK_0705

@VladimirRosu_116627 @TonyZhang @VladimirN 

 

For now I have ignored the rows from starting which I don't want in my final infotable via for loop but it will be good to have some method which can provide Last N rows also of an infotable just like TopN method.

1 reply

24-Ruby III
January 27, 2022

 Hi,

 

There was a similar question before - "How to get certain number of rows from Infotable": https://community.ptc.com/t5/ThingWorx-Developers/How-to-get-certain-number-of-rows-from-Infotable/td-p/610708 

RK_07051-VisitorAuthor
1-Visitor
January 27, 2022

@VladimirN  The link shared is for First N Rows the method is TopN. But I need Last N Rows of an infotable.

Support
January 30, 2022

@RK_0705,

 

Currently there's no LastN or BottomN snippet available but might be released in the future.

You can post your idea in below site.

https://community.ptc.com/t5/ThingWorx-Ideas/idb-p/thingworxideas

 

For now you can consider using built-in Sort function (snippet) to sort on a column in descending order so you get your infotable rearranged in reversed order.

Then use TopN to extract the rows you want.