Showing posts with label matrix. Show all posts
Showing posts with label matrix. Show all posts

Friday, March 30, 2012

Multi-value Parameter Calculation

OK Guys....

If you answer this one, you will save my life...and you WILL be the MAN or WOMAN!!!!

Problem: I have a set of 24 matrix's that need to calculate the difference between the last two years and display in a field to the right of the last rendered column. Since I have been struggling with this, let's just assume there is no better way than how I currently have it set up. (one table that does the calculations for me and I set one field on the report to display the most recent two columns difference in my report)

what I can not figure out is: when I choose one of my parameters the report displays the information I want...but when I choose more than one...well there is the problem....

In order to obtain the most help for myself I will ask this in the most general way possible so as not to get bogged down into my specific solution...

Desired Result: How to pass all my parameter values from my multi-value parameter during runtime to a SQL Stored proc from my dataset within Reporting Services at runtime, Match the parameter to the field, get the result and store it in a variable, then do it again and add the second to the first within the variable, and so on and so on , until all of the parameters are used. Then sum the values and display in a field.

HELP, HELP, HELP Please....

c-mon anyone know how to do this?|||

Well, I think you might have gone a bit too general for me to really follow what you're asking.

Have you narrowed down at all where the problem lies?

As far as Multi-valued parameters and Stored Procs,

You may have noticed that if you use a text query instead of a stored procedure, you can use the syntax:

Code Snippet

select * from foo where bar in (@.MultiValuedParameter)

And you are looking for a way to do the same, but use a stored procedure. Is that about right, or are you wanting me to comment on your 24 matrices?

If you are using sql2005, you can get very close if you use a table-valued function instead of a stored procedure, as long as your stored procedure does not modify the database in any way.

The way you would do that by creating a text dataset that looked something like this:

Code Snippet

SELECT *

FROM foo CROSS APPLY fnNewTVF(foo.bar, ...)

WHERE foo.bar IN (@.multiValuedParameter)

Cross Apply passes each value for foo.bar to your function in turn, as you described.

If you must use a stored proc, you can either use JOIN to make a comma-delimeted string value to your stored procedure, or you can use some custom code that will generate the query you need on the fly.

Does that answer your question?

|||Thank You....

Friday, March 9, 2012

Multiple table or matrix under one grouping

Is it possible to have multiple tables or matrixes under one header grouping. I'm having a case where two tables need to be under one grouping (like "Sports vehicle) and under that "sports vehicle" I have two very different tables and on it goes for each grouping (next one like "Off road vehicle), etc.

Is there anyway to do this. I can make this work with one table using the table grouping.

Any suggestions or ideas?

Thanks.

Enkht,

Yes, It possible to have a Matrix Group = "Sports Vehicles" and the have type of "Off road", "Soup Up", "Etc" - It believe you can achieve your results my making Sport Vehicles your Group rows and "Type of" your Group Columns.

Ham

Multiple subtotals in a Matrix

I would like to set up a report which would look simular to

Mon Tues Wed Thurs Fri Total Month to date total

salesguy1 10 5 11 10 9 45 120

SalesGuy2 9 1 15 0 0 25 89

I have created a matrix which shows the data upto total.

Is there a way to include the Month to date total after total?

Thanks

Any Ideas Anyone?|||Any Ideas? Anyone?

Multiple subtotals in a Matrix

I would like to set up a report which would look simular to

Mon Tues Wed Thurs Fri Total Month to date total

salesguy1 10 5 11 10 9 45 120

SalesGuy2 9 1 15 0 0 25 89

I have created a matrix which shows the data upto total.

Is there a way to include the Month to date total after total?

Thanks

Any Ideas Anyone?|||Any Ideas? Anyone?