Solved

Dynamic changing of row grouping using vaules from parameter

Posted on 2011-03-08
5
829 Views
Last Modified: 2012-05-11
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
Comment
Question by:skarru
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

by:lcohan
ID: 35073871
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
 

Author Comment

by:skarru
ID: 35074008
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
 
LVL 39

Expert Comment

by:lcohan
ID: 35074042
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
 

Author Comment

by:skarru
ID: 35075262
This is my stored procedue can you please let me know how to modify it according to group. SP.txt
0
 
LVL 39

Accepted Solution

by:
lcohan earned 300 total points
ID: 35083231
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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by Valentino Vranken. A while ago I wrote an article called Chart Optimization Tips (http://www.experts-exchange.com/articles/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Chart-Optimization-Tips.html).  This article explained how …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now