I have created a stored procedure where its columns can change names and the number of columns fluctuate as well. Is there a way to auto generate the report in SSRS depending on the result set. My main concern is to output from 3 columns to lets say 10 columns. Any assistance would be greatly appreciated. Thank you.
You can toggle the visibility of columns using the Column Visibility in conjunction with some parameter you define for control flow. It is a bit more difficult to do column wise shifting then row shifting, as with groups. Another thought would be to look into column grouping. In SSRS you can simulate the PIVOT command using column groups.
You can use the matrix, which will show the number of columns as they are generated.
Include (Drag from DATASETS) your data in DATA and the field (dynamic column) in columns.
Hope this helps you.
Related
I have a form data wherein tableau I am using the below value to find out the choices for a multiple value question. The question is Could you please indicate one or two areas where we fell short.
the value can be explosives, vehicles, cement etc
I have individually accounted for each of the choices in the below calculated field:
int(contains(lower([Could you please indicate one / two of the following areas where we fell short of meeting your expectations?]),'factory'))
Similarly I have found out for other values:
The calculated fields are hasvehicle, hasfactory etc
But the problem is how can I visualize the same in the form of bars?
All I am able to do is this:
How can I visualise the same in the form of bars side by side?
When you have one measure on Rows, drag the second measure and drop it in the axis.
It will result with Measure Names on the Columns shelf and Measure Values on the rows shelf.
I have created 9 calculated fields that return the desired results. Now I want to create a single dimension (or measure if more appropriate) that combines the fields into one by appending the data, not creating a combined string field. I know I can do this in Excel very easily, but am at a loss in Tableau. Please see screen shots for more information.
Pic 1- This is the code for each calculated field (only the number of minutes are changed). > 75 also has an if statement attached.
Pic 2 - This is a combined field of all the data I want in one column. This is validating that my calculation fields are returning the desired result.
The end goal is to create a single bar chart based on the combined data. Thanks for any assistance.
I may be wrong, but get the feeling what you want to achieve can be done by dragging the "Measure Values" into your visualization, and then the "Measure Names" into color, or whatever else. You can filter on "Measure Names" to include only those measures you created, and they will be represented as one pill, but will include all of the values and retain them as individual measures.
This seems pretty simple, but I can't seem to find a way to do this.
I need to multiply all rows in a chart - or all columns, whichever is easiest. AKA. I am looking for something like the product() function in Excel.
Any ideas on how to accomplish this?
EDIT: Row values may change, so this needs to be a dynamic calculation. Like a function to aggregate all values into a product of the values.
A calculated field can be created with: sum([Sales])*PREVIOUS_VALUE(1)
This gives the running product. Then, that field can be inserted into the table.
You can certainly create a calculated field that will multiply various columns together. Something along the lines of [Column1] * [Column2] * [Column3] will generate a new calculated measure that is the product of all three columns.
That being said, if you're doing that much data manipulation within Tableau, you should probably be giving some hard thought as to why that's necessary. While calculations are certainly possible and new Tableau 9 features such as level of detail functions make doing calcs on measures not present in your viz easier, Tableau is primarily a data presentation layer. Data manipulation apart from simple calcs and pivot/unpivot operations should be done upstream. Doing advanced manipulations within Tableau, while sometimes/often possible, can be very hard to debug and reproduce.
UPDATE
When I first asked this question, I didn't fully understand what the problem was. Your best bet is to glance over the issue below and then read my answer.
I have a report with a matrix where the data looks like the following:
Name Id Activity 1 Activity 2 …Acitivity N
Smith 1 77 100 nn
Johnson 2 88 99 nn
Name and Id are in a group.
When the number of activities are greater than 11, I need the columns Name and Id to repeat when the report renders in a PDF.
Here is an example of report recently run:
Page 1 (NOTE: red boxes indicate
personal data filtered out):
Page 2:
I've been fiddling with the properties RepeatRowHeaders and RepeartColumnHeaders, but I have had no success.
How do I make this column repeat?
Sadists can check out the rdl file here.
Short Answer (and a plea from me):
Please vote on this Page to conditionally hide non-group matrix columns.
Long Form:
I found the solution to my problem, but first was figuring out the exact issue. An SSRS Matrix has the ability to repeat columns on subsequent pages as its width grows when RepeatRowHeaders and RepeatColumnHeaders are set to True. So that part of my report setup was fine.
My problem was that my grid was set up as follows:
What you see above is a Tablix containing a Matrix. The blue represents a normal Tablix with four columns. The green Represents a Matrix within Column 4 that has N number of columns.
So even with the properties RepeatRowHeaders and RepeatColumnHeaders set to true, Columns 1-3 would not repeat as the data in the Matrix extended to multiple pages. This is because the outer Tablix (e.g. the blue part) only saw Column 4 as growing outwards instead of the individual columns in the inner matrix.
In order to make the columns repeat, I had to alter the grid like so:
This grid is only one matrix; not a Matrix within a Tablix as the first image depicted. I pulled the matrix out and added "Static Columns" to the left. This made Columns 1 - 3 repeat on multiple pages as the Matrix grew.
All seemed well, but here's the rub: Static Columns cannot be hidden or, more aptly put, you can hide the data within a column, but the column itself will not shrink.
So, when I hid Static Column 3, my report looked something like this:
Notice the white-space Gap. This solution simply would not work. When I found that I was stuck in an either/or situation (either have the ability to conditionally hide columns or Repeat Columns on Subsequent Pages), I used one of our Microsoft Support Incidents to analyze the report and come up with a solution.
Microsoft was nice and knowledgeable and even pointed to a article in their forum stating they were considering allowing SSRS to have the ability to hide static columns. However, in the end, they said we were stuck with the either/or situation. (BTW, note that forum thread was answered in 2006.)
So after that long process with Microsoft, we were still stuck with our dilemma. Fortunately, one of our fellow programmers came up with a workaround: put the columns you want to toggle visibility within the Matrix itself.
And that's what I did. It took some finagling with the report SQL (and creating a statement I'm not particularly proud of), but it works.
So now the working report looks like this:
That's one Matrix, two static columns that always need to repeat on every page and Column 3 which is now part of the dataset used for the Matrix.
Once again, I plead with the community to vote on this Page to conditionally hide non-group matrix columns. It would make constructing future reports like this much easier :)
I have problem relating to pivot query and matrix reporting. I don't know how to display it on matrix reporting service so it will dynamic column. Can any body help me to show how to configure the matrix table? or could you give the link where can I find the answer of my problem? I'm newbie in reporting service.
Think of a matrix control as a 'design time pivot table'
Once it has been designed and it has rendered the data, the output is fixed - you cannot drag and drop like you would with a pivot table.
The matrix control can have dynamic row/column groupings which will grow with your data.
It's pretty easy to use once you get your head around the concept of 'inscope'
To create dynamic columns, you just need to create a column grouping (towards the top right section of the matrix control once you have dragged it on to the form) Just tell it which field to use as a grouping.