OK, so I am wanting to pull the top 3 rows of data of a certain column/row into separate labels. Youll see here that the top 3 rows have values of 53,51,30 in the ASRS Buggy Count column.
I have this table being sorted by that column to show descending.
When I try this on a label of the table, I am returning the tag query value of row 1 instead of the sorted value.
{../Table_ASRS.props.data}[5]
The label returns a value of 7.
How can I have that label show whats been sorted without having to rewrite the table query?
props.data is what you deliver to the table. What sorting and/or filtering you perform in the browser isn't changing that. What you select should be return to you (back to the gateway) in props.selection.data. Without selection, the filtered/sorted dataset is not returned to the gateway at all.
Look at props.filter.results.data after setting props.filter.results.enabled true. Note the warning in the manual if you do this.
The easiest way is to do just that. Add ORDER BY [ASRS Buggy Count] DESC
into your default query. Then the user can sort whatever way they like but the top three will still show up in the label.
If you are using my Integration Toolkit, you can save a bit on the DB side by running your raw props.data through my orderBy() expression function. Perhaps wrapped with my where() function to give you just the top three.