How to filter dataset

Hi ,

 

I want last three rows of dataset. What are syntax for that or do we have any function which can return filter rows ?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi just out of interest, if you are the one who is querying the data (using your queryentity or queryrule) and expecting only last 3 rows always, then simply you can make the use of paging info where you need to provide the sort attribute values, where field will be your primary key and ascending must set to false

    Example

    a!pagingInfo(
    1, 3, a!sort("id", false())
    )

    I believe this must be your approach instead of querying Multiple set of rows (which are not needed / you don't these data) and later applying filter over this data. Unless you are receiving this data from some other sources and you are not the one who is querying the data.

    Using this approach, it will query only the required set of rows(last 3 rows) which you are needed.

    However this also depends upon, from where are you receiving the data (using your own rule / any external sources)
Reply
  • 0
    Certified Lead Developer
    Hi just out of interest, if you are the one who is querying the data (using your queryentity or queryrule) and expecting only last 3 rows always, then simply you can make the use of paging info where you need to provide the sort attribute values, where field will be your primary key and ascending must set to false

    Example

    a!pagingInfo(
    1, 3, a!sort("id", false())
    )

    I believe this must be your approach instead of querying Multiple set of rows (which are not needed / you don't these data) and later applying filter over this data. Unless you are receiving this data from some other sources and you are not the one who is querying the data.

    Using this approach, it will query only the required set of rows(last 3 rows) which you are needed.

    However this also depends upon, from where are you receiving the data (using your own rule / any external sources)
Children