Can't Repeat Column Groups AND ALSO hide Static Columns within a Matrix - ssrs-2008

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 :)

Related

Form data evaluation

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.

Boxplot is broken, only showing one line

so my data centres around different treatments and how they impact the day of germination. image of dodgy boxplot data
A while ago whilst making violin plots in R to show the distribution of when germination occurs according to treatment, I attempted to add a boxplot as a descriptive statistic and was met with only one line.
I contacted many people who simply had no idea what the issue was, I used this same data in another violin plot as part of a bigger data collection with more treatments including this one.
I moved on from this and found it odd, now when I have come to perform stats tests in SPSS, I have the same problem as imaged below. When I try a Mann Whitney U test I am told "cannot compute" due to not having solely two variables, when I try a Kruskal Wallis test I am met with the dodgy boxplot below and I am told pairwise comparisons cannot be done due to less than 3 test fields (i.e. 2).
I am at an absolute loss, I have tried rewriting the data out, copying data labels with 'stratified' 'strat' 's' etc and I have no idea where the problem could lie, if anyone could give me any guidance this would be really appreciated!
Thank you
The dependent variable in question appears to have only values 1, 2, and 3 in the Stratified group. If there is at least one case with a value of 1, at least one case with a value of 3, but most values at 2, then a box plot like you're seeing would be expected. In SPSS, run the EXAMINE procedure (Analyze>Descriptive Statistics>Explore in the menus), specifying the same dependent variable and grouping variable, and asking for percentiles. The box plots should match what you're getting, and in the percentiles table you should see that Tukey's hinges show the same value of 2 for the 25th, 50th, and 75th percentiles.
Tukey's hinges are the basis for the box and the line in box plots. The line is at the median or 50th percentile, and the upper and lower box edges are at the 25th and 75h percentiles, respectively. When all three coincide, you get just a line instead of a box.
There are two types of outlying values identified in box plots in SPSS. Points greater than 1.5 box lengths below or above the box edges are outliers, marked with circles, and points greater than 3 box lengths below or above the box edges are extremes, marked with asterisks. Since the box length here is 0, anything at other values is automatically an extreme.
Pairwise comparisons following a Kruskal-Wallis test are available only when there are at least three groups, since with only two groups the overall or omnibus test has already compared the two groups. I'm not sure what the issue was when trying to run a Mann-Whitney test.

How do I sort this scatter plot?

I would like to sort this scatter plot, which is summarized with a Band that includes Minimum, Average, and Maximum.
I would like to sort it in 2 ways:
by Average
by Widest Range (ie difference between Minimum and Maximum values)
Tableau Public workbook
If you can't view this or I'm not allowed to post external resources on stackoverflow, then perhaps you can show me on this screenshot what I would click to get started on the following sort
Also, bonus question, is there a way to create a control for the user to toggle between the 2 sort methods in the same chart? Or do I have to duplicate the chart with a different sort type for each?
One note is that I only have Tableau Public version since I'm evaluating the product. Until I get a paid version, I can't open a workbook file unless you publish it to Tableau Public cloud. But rather than give me the workbook answer, I would just appreciate it if you gave me instructions to do this as this is more of a learning exercise.
Thanks!
Somewhat unfortunately, you'll have to replicate the min,avg,max by creating 3 calculated fields. Tableau cannot operate on the values placed on the view via reference lines.
These calculations might look something like these:
{Fixed [Cwe]: Min([Cvss Score])}
~
{Fixed [Cwe]: Avg([Cvss Score])}
~
{Fixed [Cwe]: Max([Cvss Score])}
In general, from there, you should pretty easily be able to apply them to the view and sort. Average will be easy. The difference between Min and Max will just need a subtracting calculated field to sort by. Once they're on the view, I'd put them as a dimension (column) to verify that the numbers look correct.
Take note that LOD calculations take place before filtering, so you'll want to put the Cvss filter you have there 'on context' by right clicking it and clicking 'add to context'
Here is how I would complete the sorts:
Starting with all the above calculations on 'Rows' and ensuring that they are 'Dimensions' (Blue).
After right clicking "Sort..." on [Sub-Category] on 'Rows'. Select which field to sort by.
From there, the calculated fields can be taken off the rows column. (They were only there in the first place to ensure that you could check that the sorts took place. They don't actually need to have been there in the first place.)

Tableau Dual Axis with different filters

I am trying to create a graph with two lines, with two filters from the same dimension.
I have a dimension which has 20+ values. I'd like one line to show data based on just one of the selected values and the other line to show a line excluding that same value.
I've tried the following:
-Creating a duplicate/copy dimension and filtering the original one with the first, and the copy with the 2nd. When I do this, the graphic disappears.
-Creating a calculated field that tries to split the measures up. This isn't letting me track the count.
I want this on the same axis; the best I've been able to do is create two sheets, one with the first filter and one with the 2nd, and stack them in a dashboard.
My end user wants the lines in the same visual, otherwise I'd be happy with the dashboard approach. Right now, though, I'd also like to know how to do this.
It is a little hard to tell exactly what you want to achieve, but the problem with filtering is common.
The principle that is important is that Tableau will filter the whole dataset by row. So duplicating the dimension you want to filter won't help as the filter on the original dimension will also filter the corresponding rows in the second dimension. Any solution has to be clever enough to work around this issue.
One solution is to build two new dimensions that use a calculation rather than a filter to create the new result. Let's say you have a dimension, [size] that has a range of numbers from 1 to 10 and you want to compare the total number of rows including and excluding the number 5. You could create a new field using a formula like if [size] <> 5 then 1 else 0 end
Summing the new field will give a count of the number of rows that don't contain a 5 and this can be compared directly to a rowcount of the original [size] field which will give the number including the value 5.
This basic principle can be extended to much more complex logic. The essential point is to realise that filters act on every row in your data and can't, by themselves, show comparisons with alternative filter choices on a single visualisation.
Depending on the nature of your problem there may be other solutions worth looking at including sets and groups but you would need to provide more specific details for users here to tell you whether they would be useful.
We can make a a set out of the values of the dimension and then place it in the required shelf. So, you will have your dimension which will plot accordingly and set which will have data as per the requirement because with filter you can't have that independence of showing data everytime you want.

Different Aggregation calculations of a measure using two dimensions in Tableau

It is a Tableau 8.3 Desktop Edition question.
I am trying to aggregate data using two different dimensions. So, I want to aggregate twice: first I want to sum over all the rows and then multiply the results in a cummulative manner (so I can build a graph). How do I do that? Ok, too vague, here follow some more details:
I have a set of historical data. The columns are the date, the rows are the categories.
Easy part: I would like to sum all the rows.
Hard part: Given this those summations I want to build a graph that for each date it shows the product of all the summations from the earlier date till this date.
In another words:
Take the sum of all rows, call it x_i, where i is the date.
For each date i find y_i such that y_i = x_0 * x_1 * ... * x_i (if there is missing data, consider it to be one)
Then show a line graph for the y values versus the date.
I have searched for a solution for this and tried to figure it out by myself, but failed.
Thank you very much for your time and help :)
You need n calculated fields (number of columns you have), and manually do the calculation you need:
y_i = sum(field0)*sum(field1)
Basically because you cannot iterate on columns. For tableau, each column represent a different dimension or measure. So it won't consider that there is a logic order among them, meaning, it won't assume that column A comes before column B. It will assume A and B are different things.
Tableau works better with tables organized as databases. So if you have year columns, you should reorganize your data, eliminate all those columns and create a single field called 'Date', which will identify the value of your measure for that date. Yes, you will have less columns but far more rows. But Tableau works better this way (for very good reasons).
Tableau 9.0 allows you to do that directly. I only watched a demo (it was launched yesterday), but I understand that now there is an option to selected those columns (in the Data Connection tab) and convert them to a database format.
With that done, you can use a PREVIOUS_VALUE function to help you. I'm not with Tableau right now. As soon as I get to it I'll update this with the final answer . Unless you take the lead and discover yourself before that ;)