• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 852
  • Last Modified:

Dynamic changing of row grouping using vaules from parameter

Hi All,

I want to change the  row grouping values(in a matrix report) dynamically depending on the values of a parameter.
For EX. I Have a column grouping for category for total price in a matrix report and i have a row grouping on States . But i want to change the row grouping from states to customers depending on the value passed in the parameter. How can i do that?

- Karru
0
skarru
Asked:
skarru
  • 3
  • 2
1 Solution
 
lcohanDatabase AnalystCommented:
For that you need to write a SQL SP that will take that report parameter and use it inside the SQL SP to build dynamic SQL code that you execute from there.
0
 
skarruAuthor Commented:
The fields i have taken in matrix are from a sp...so my doubt is will the report accept value from another sp for the same field?
0
 
lcohanDatabase AnalystCommented:
Ok, so you should modify that SP to include the new parameter and if not null build dynamic code then execute with new group by.
0
 
skarruAuthor Commented:
This is my stored procedue can you please let me know how to modify it according to group. SP.txt
0
 
lcohanDatabase AnalystCommented:
Please see updated attached - I changed it to CREATE and added _NEW suffix to not touch existing by accident. You may need to addapt/adjust your code but this is what I was talking about and hopefully suit your needs.
sp-new.sql
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now