Rank: Newbie
Groups: Registered
Joined: 2/14/2019(UTC) Posts: 5 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.
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 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'
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/14/2019(UTC) Posts: 5 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.
|
|
|
|
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.