Skip to main content
15-Moonstone
August 2, 2021
Solved

How to Sort infotable values in a Arithmetic order

  • August 2, 2021
  • 1 reply
  • 1125 views

I have one infotable which returns plant names. I would like to generate infotable in a arithmetic way. I am able to sort ascending but I am trying to sort infotable in a arithmetic order but not able to find any snippets regarding arithmetic approach.

 

sabhz_0-1627886326061.png

 

Best answer by sabharees

Hi I found a way for this approach,

 

I've created one datashape with additional field as number, then used parseInt() to separate numerical values from PlantName field, and added those values as separate entry in new infotable along with the PlantName values.

After adding that, I used sort functionality from InfoTableFunctions sorted numbers field ascending isTrue.

 

Able to get expected output.

Hope this will be useful for someone someday !! 🙂

sabhz_0-1627890814638.png

sabhz_1-1627890839895.png

 

1 reply

sabharees15-MoonstoneAuthorAnswer
15-Moonstone
August 2, 2021

Hi I found a way for this approach,

 

I've created one datashape with additional field as number, then used parseInt() to separate numerical values from PlantName field, and added those values as separate entry in new infotable along with the PlantName values.

After adding that, I used sort functionality from InfoTableFunctions sorted numbers field ascending isTrue.

 

Able to get expected output.

Hope this will be useful for someone someday !! 🙂

sabhz_0-1627890814638.png

sabhz_1-1627890839895.png

 

16-Pearl
September 8, 2025

You have already got a solution but additionally i would like to propose another solutions for Infotable sorting

 

1) 

Sorting	
 An	
 InfoTable	
 by	
 any	
 Column
// Create a new InfoTable containing all rows
// But now reordered Alphabetically by the name property
var result = Resources["InfoTableFunctions"].Sort(
 {
 sortColumn: "name",
 t: me.groupA,
 ascending: true
 }
)

 

2) 

var query = {
 sorts:
 [
 {
 fieldName: "age",
 isAscending: false
 }
 ],
 filters: {
 type: "AND",
 filters:
 [
 {
 type: "LT",
 fieldName: "age",
 value: 20
 }
 ]
 }
};
var result = Resources['InfoTableFunctions'].Query(
 {
 query : query,
 t : me.groupA
 }
);