DMXzone Server Connect Support Product Page

Solved

Group by

Reported 22 Jun 2017 17:27:00
1
has this problem
22 Jun 2017 17:27:00 Brad Lawryk posted:
How do you do a 'Group By'? I can't see it available anywhere?

Replies

Replied 23 Jun 2017 18:10:45
23 Jun 2017 18:10:45 Brad Lawryk replied:
Okay I found where to add a Group By but whenever I add a Group by it no longer shows any results. This is becoming so freaking frustrating. Such a simple thing yet it doesn't work and there are no documentation on it. Two days spent trying to get a simple group by or even a unique collection to work and nothing.

Anyone get a Group By to work? I'm about to lose it.
Replied 24 Jun 2017 09:01:09
24 Jun 2017 09:01:09 Greta Garberini replied:
Sorry, couldn't find it either. Documentary is next to lousy on these extensions. The movies show one or two scenarios but if you need a slightly different procedure you're left with guessing.
So, how / where do you put Group By?
Replied 24 Jun 2017 16:56:35
24 Jun 2017 16:56:35 Brad Lawryk replied:
Hi Greta,

Here is where you can get to set up a Group By ... however inside the repeat it shows nothing. But anyways, here is how to get to the Group By function. If you can figure it out from there please let me know. ;-)

www.dropbox.com/s/erm6l7pa7zmi7m2/groupby.mov?dl=0
Replied 25 Jun 2017 06:50:22
25 Jun 2017 06:50:22 Teodor Kuduschiev replied:
Hi Brad,
That's right the group by filter is being applied on a collection (the data returned by the query) so the collection filters are only showing when a collection is selected. It is the UI that is selection sensitive, this way we provide the users only the right filters for their selection on the page. With the old data formatter, there were many users trying to apply numeric filters to strings, collection filters to single items etc. and then reported it as not working.

I will investigate what is wrong with the Group by filter and will let you know if this is a bug in the extension.

Greta, of course it is not quite possible to cover all the users cases out there... every user has his specific config, so we show the basics in separate videos, and when you check them you can just combine them after that.
Replied 25 Jun 2017 06:55:36
25 Jun 2017 06:55:36 Teodor Kuduschiev replied:
I personally prefer grouping data on the serverside in the server action. For example, if i have two queries - categories and products i usually do this in server connect:

- categories query (uncheck output option)
- repeat categories query (select the output fields here, which you want to show later on the page); Enable output option.
- (inside the repeat) products query filtered by category ID.

On the page, create a repeat region out of the categories repeat step. Inside it nest another repeat from the products query.
This way on your page you will have:

[Category 1]
- product 1
- product 2
[Category 1]
...

[Category 99]
- product 100
- product 102
- product 999
[Category 99]
...
Replied 25 Jun 2017 08:35:26
25 Jun 2017 08:35:26 Brad Lawryk replied:
Ok, here is what I desperately need. I have a table that I only am using one field. This table itself contains contains two fields. Workshop names and dates. The workshop names could be repeated several times as they take place on several dates. I simply need to take the workshop names and create a drop menu (select form field) that has the workshop names but only display the names once.

So you gave a query that simply has just the workshop names field in it. There are over 80 workshops in total but only 9 different names. So I need to create a drop menu with just those nine names.
This reply was removed on 6/25/2017 11:54:54 AM.
See the changelog
Replied 25 Jun 2017 12:00:04
25 Jun 2017 12:00:04 Greta Garberini replied:
Thanks Brad,
Have you tried "distinct" at the server-action file?
Replied 25 Jun 2017 12:06:34
25 Jun 2017 12:06:34 Brad Lawryk replied:

QuoteHave you tried "distinct" at the server-action file?


Oh jeez, I didn't even see that small tiny little checkbox. That worked for what I needed immediately. Would still like to get Group By sorted out though. Thank you so much Greta. Such an easy solution. lol
Replied 27 Jun 2017 00:06:55
27 Jun 2017 00:06:55 Brad Lawryk replied:

Quote
- categories query (uncheck output option)
- repeat categories query (select the output fields here, which you want to show later on the page); Enable output option.
- (inside the repeat) products query filtered by category ID.


Can you explain this a bit further? I cannot get any results to show in nested repeats at all.

What is the purpose of the categories query that you uncheck the output option if you just duplicate it with the option checked? What do you do with the first query?

By your example you have two tables? My needs is one table ....

Table = [trackID][trackKID][tracktime][trackReason][trackClient]

What I need is an output such as = (Grouped by [trackClient])

[trackClient]
- [tracktime]
- [tracktime]
- [tracktime]
- [tracktime]
[trackClient]
- [tracktime]
- [tracktime]
[trackClient]
- [tracktime]
- [tracktime]
- [tracktime]

and so one


A video on nested repeats would be nice. I have spent so much time on this.
Replied 27 Jun 2017 06:28:37
27 Jun 2017 06:28:37 Teodor Kuduschiev replied:
Hello Brad,
The purpose of disabling the output option on the first query is that we do not want to render it on the page, but only need it as a resource for the repeat step, which repeats it ...
Then you use this repeat step as a source for the main repeat region on the page.
You can achieve what i suggested with one table also, no need to have your data in separate tables. It is really really simple:

1. Create query and use distinct for the trackClient (disable output)
2. Create a repeat step, and use this query as a source for it. Select trackClient as an output field, so you can bind it on the page. (and enable output)
3. Inside this repeat step add another query, from the same table, no distinct this time, but filter it by the trackClient returned by the repeat step.
4. Create a main repeat region on your page, using the repeat step as a source. Bind trackClient inside it.
5. Nest another repeat region from the query inside the repeat step and bind the tracktime there.
Replied 27 Jun 2017 16:59:15
27 Jun 2017 16:59:15 Brad Lawryk replied:
Thanks for that 'Step-by-Step' instruction. Worked awesome. Exactly what I needed.

Now my next step is to figure out how I can list them in order of the number matching trackTime results so the trackClient with the most trackTimes is listed first. Is this possible?
Replied 30 Apr 2018 12:35:09
30 Apr 2018 12:35:09 Bruce Wilkie replied:
Hi there

Got the same problem.
How do you use 'distinct' in the query?
I can't see it anywhere

thanks
Bruce
Replied 30 Apr 2018 12:44:33
30 Apr 2018 12:44:33 Bruce Wilkie replied:
Never mind, found it

Reply to this topic