Hi, is there a way to limit the query to a few rec...
# gooddata-ui
Hi, is there a way to limit the query to a few records with useExecutionDataView? The pivot table works perfect, it's has some super advanced features by default, like scroll on load and so on, this is amazing. But if I need to customise the table like color certain data point, I need to query with useExecutionDataView and the dataset is very large, takes 18 seconds. Any workarounds, like pagination for query or limit to first x records?
@Michael Serres Hi,
hook you are using consumes this as its param
Copy code
config: IUseExecutionDataViewConfig & UseExecutionDataViewCallbacks
Check the documentation of IUseExecutionDataViewConfig and you will see there is prop called
where you can specify offset and size limit for execution result
Oh nice, that's the "advanced" part of the docs. Thanks, will give it a try.
const { result, error, status } = useExecutionDataView({ execution: { seriesBy, slicesBy, filters }, window: { offset: [0], size: [500] }, }); Works beautifully. There's for first 500 records. Since offset and size are arrays, anything else I should know @Ivan Nejezchleb?
Hello @Michael Serres. Offset/size are arrays because you should specify it per each dimension. Most of the time, you need only 1 or 2 dimensions, and the offset and size will be the same. But in some cases, you may need different offset / limit per dimension - good example is pagination of the pivot table. I’ll make a ticket to describe it in a better way on a
Quite powerful, thank you. much appreicated.