Hi guys I have a table which I want to filter so that the unique session ID only unique ones and not multiples.
I have added the unique but when I preview it, it just shows lines (see image)
As soon as I take the unique away then its show the information but show all the session ID’s
It also does the same if I add a group by on the table
Hi Peter,
The unique filter does not work like that.
With the unique you can take the unique values from a query, but not like you are using it. It is used like:
dmx-bind:repeat="serverconnect1.data.query1.unique(`city`)"
and then in the repeat region, you bind the:
{{$value}}
and then it returns the unique values for the city.
In your case, if the session in the table has more than one entry with different order/id etc. - then which one should it display on the page (first, second, random, last)?
the orders have a unique session ID and if they have more than one product it will create a line for each one in the DB, all I want to be able to do is in this list I am working on is for it to only show 1 of the session id. I will then have a button to view the order which will search the session id,
But do you need to just show the session then, without the other properties?
If not - which values for the rest of the properties be displayed?

So I need to show
Order Date | Order Status | Customer ID and have these Grouped by Session ID
Peter i think i don’t really get your concept.
First you said that you want to show one row per session - i.e. display one record per session.
Now you say you want to group the records by session - i.e. display multiple records per session.
Can you please show an example of how do you expect your data to be displayed exactly on the page or in the table?
OK here goes:
OrderID | Name | Product | Session
1 | Joe | A | 123456
2 | Joe | B | 123456
3 | Frank | A | 654321
On this table that I want the group by to do at the moment it will show all 3 of the above, but what I want it to show is just 1 & 3 (as there are 2 sessions with the same value) when I then click a button it will select the records with the session value and will show the 2 products, this part I have no issue with)
My only need is to stop all the sessions showing (when they are the same value) and just to get one to show.
Does that make sense??
Yes it makes sense, but i still didn’t get a response on my question: How do you decide which of the values to show in the table (when choosing between 1 or 2)? What is the logic?
And by the way that’s not really a group by.
The group by would look like:
- Session 123456
Joe | A |
Joe | B | - Session 654321
Frank | A |
yes that’s how it would look when I click into the order and search the session id
the logic is in the table that shows my orders I only want unique sessions id showing for example:
Table List (this is what I am try to get right)
- Session 123456
- Session 654321
At the moment to table list is showing
- Session 123456
- Session 123456
- Session 654321
When I click in and run another server action to filter the DB on the session id, then it would show:
- Session 123456 Product A
- Session 123456 Product B
Well that's a different thing. Here you really just need a table with one column, and the unique applied to the repeat expression (just like in your first screenshot).
Then in the table row you use {{$value}}, not {{sessionID}} and it will return the unique values.
