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.
Solved! Go to Solution.
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 !!
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 !!
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
}
);