Show record minus first six already in another query

I have a site with articles. The number of articles and images shown is limited to 6.
I wonder if it is possible to make a dbase query to select the rest of the articles minus the 6 already shown to put them in a list below the articles shown.
And of course, if that can be done, how do I get it done. :sweat_smile:

You can use the same query and for the repeat use query.count(or total) - (minus) top 6 :slight_smile:
Not in front of a computer currently, so just check the formatters :slight_smile:

1 Like

Thanks, will check this out.

I have the repeat showing all the records limited to 15-6. The dbase query is set to order bij date > desc. But with the present syntax it will show the first 9 of the sorted records instead of the last 9. What am I doing wrong here?
<div class="col-4" dmx-repeat:rptbtm="scnwsbottom.data.qrynwsbtm.top(15-6)" id="rptbottom">

Simple maths, you need to show the LAST (TOTAL - 6) records, so it should be:

dmx-repeat:rptbtm="scnwsbottom.data.qrynwsbtm.last(scnwsbottom.data.qrynwsbtm.count() - 6)"

I have always been bad at math. Thanks a million

1 Like

You can even extend this and make it more flexible/dynamic.

  1. Create two variables in app connect:
    • featured
    • bottom
  2. Set the number of featured records that you need to display in the featured variable.
  3. For the bottom variable (you need math again) set this as a value:
(serverconnect1.data.query1.count() - featured.value)

of course this can be done entirely via the UI:

  1. For the featured repeat region use:
serverconnect1.data.query1.top(featured.value)
  1. For the bottom repeat region use:
serverconnect1.data.query1.last(bottom.value)

This way, you can change just the featured variable value at any moment and the rest will be automatically calculated :slight_smile:

1 Like