logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
ptsepeli  
#1 Posted : Friday, June 28, 2019 3:31:38 PM(UTC)
ptsepeli

Rank: Newbie

Groups: Registered
Joined: 2/14/2019(UTC)
Posts: 5
United Kingdom
Location: Harpenden

Was thanked: 1 time(s) in 1 post(s)
I have a report that groups by multiple columns.
What would you recommend doing if you need to change the order of the grouping dynamically?
For example, based on restrictions I want to:
group by Field1, then Field2 and then Field3 and then Field4.
or group by Field3 then Field1 (don't group Field2 or 4)
or anything the user chooses...
The only solution I can think is having a custom SQL and display the fields under aliases:
Code:
select Field1 as Grouping1, Field2 as Grouping2, Field3 as Grouping3, Field4 as Grouping4 from table

or
Code:
select Field3 as Grouping1, Field1 as Grouping2 from table

which I think I can do.
I'm just wondering if this is already covered in SR.

Congratulations on the awesome product.
epf  
#2 Posted : Monday, July 1, 2019 7:51:00 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 205 time(s) in 198 post(s)
Yes, nothing in SR can handle this...
Changing the alias seems interesting, good luck in this direction.

You may also have a look at the sample: '52-Input Values - Select columns to display'
ptsepeli  
#3 Posted : Wednesday, July 10, 2019 2:13:07 PM(UTC)
ptsepeli

Rank: Newbie

Groups: Registered
Joined: 2/14/2019(UTC)
Posts: 5
United Kingdom
Location: Harpenden

Was thanked: 1 time(s) in 1 post(s)
Hi,
Just for the record I managed to implement the solution with aliases as I mentioned above.
I added multiple restrictions with the list of the available grouping categories and called them Primary, Secondary etc.
In the pre-load script I replaced the GROUP BY pPrimary, pSecondary in the SQL with the selected values from the restrictions.
Note: I had to use a custom table in order to modify the SQL.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.