SSRS Tablix Sorting w/Row & Column Group - sorting

My matrix has a row group (QuestionText) and a Column Group (AnswerText).
It looks like this:
[AnswerText]
[QuestionText] [AnswerCount]
My Data looks like this:
QuestionText AnswerText AnswerCount
Question 1 Yes 2
Question 1 No 1
Question 2 Yes 3
Question 2 No 4
Which renders as follows:
Yes No
Question 1 2 1
Question 2 3 4
What I'd like to do is to sort by the Yes or No. Please note that both the questions and answers are just examples, they answers could be flag colors & red, white, blue...
Is this possible? I've seen someone say "it's hard". I'm ok with hard, I just need to know how.
http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/b4a242ce-e2de-463e-8732-a9f8abe493e4
Thanks for looking!

did you try just adding an order by in your sql? so you would order by QuestionText then AnswerText.

I might not be grasping this correctly, but do you just want to sort by ascending/descending # of Yes's & No's?
Try this... Go to the answertext header, and right click, then in the properties, go to the interactive sorting tab.
Select "Groups" instead of Details (radial button).
In the sort by: box, select your answer text group.
In the last section, where it says: apply this sorting to all groups and data regions in:
Select your entire matrix/tablix. Not positive, but I had a matrix and that last step was the key to sorting it...in drilldowns or groupings, etc..., sorting only works if you apply it to the whole tablix.

Related

How to create a custom formula using data validation that can sort columns using column numbers in Google Sheets?

I hope someone can help with a problem I’m facing. I’m pretty new to Data Validation using Custom Formulas so I’d appreciate your guidance. I hope I have explained the situation clearly. Thanks.
I want to use data validation in cell B1 (Portfolio Tab) which creates a drop down list of the number of columns (1 to 44). I want to use the list as a way to sort a table (Column Headers - C3:AT4).
https://docs.google.com/spreadsheets/d/1qunKbFGNzzGU9lNCPFow8igkR_gaPudmanTK-WM43mA/edit#gid=58173089
By selecting 1 from the drop down list I want my table to be sorted in Descending order by Portfolio%. Then if I want to sort by Name in Descending order I want to select 3 from the drop down list. Finally once I’m done sorting I want to revert back/reset to my original view. I want to do this without changing anything in columns A and B. Please assist. Thank You.
Issue with using asc
Issue with using asc (blank formula)
Query and hyperlink
Query and hyperlink
solution 1:
forget dropdown and use filter view inmerge row 3 & 4
delete row 1 & 4
select your range C2:AT
and creatte filter view
now you can sort one, multiple or all columns like:
solution 2:
create a duplicate of your sheet:
delete your range C3:AT
use this in C3:
=QUERY({Portfolio!C3:AT}, "order by Col"&B1&" desc", 2)
solution 3:
use sorting script... https://stackoverflow.com/questions/tagged/google-apps-script+sorting

How to disable CrossTab sort order?

I have a crossTab in my report that shows:
L S XL Changes Combination Material
Shirt 10 5 something somethiung something
Pants 2 4 something somethiung something
But I need it to be sorted like this:
Material Combination Changes S L XL
Shirt something somethiung something 10 5
Pants something somethiung something 2 4
Now keep in mind that I already sort the values the way I want them to be sorted in my stored procedure the only problem is that CorssTab has its own sorting and so far I haven't found a way to disable it.
I am using Visual Studio 2013 and Crystal Reports 13.0.10 and SQL 2014 (tho i doubt SQL version matters).
I am not allowed to change the version of VS or CR or SQL that I am using.
If needed I can provide you with everything you need in order to 'test' my question if you don't believe that my stored procedure sorts the values in one way but CrossTab ignores it.
Please check this link or this
This option is available in Cross-tab popup, below the column selection there is "Group option".
Create a Select Case formula that adds the desired sort position as a number before each group value:
Material
Combination
...
Use that formula for the CrossTab column
Then, use the CrossTab Group Options dialog, Options tab, to 'Customize Group Name Field' with the option to 'Use a formula as Group Name'.
In that expression, return MID({#ColumnFormula}, 4) to throw away the number prefix.

It is possible to sort by "valid" percentage in my data?

Using Tableau, I have arranged some data in a 100.00% stacked bar:
I want to sort the data descending (largest to smallest) by Valid component type (green) - is this possbile?
UPDATE (26th July 2017)
merawalaid's answer ALMOST worked; I followed the steps, adjusted the code to match my specific project, and it resulted in this:
As you can see, it is somewhat sorted, but not quite as it should be (for example, the fourth and sixth rows are featured too high in the chart.
Is there something that might be wrong that I have missed here?
I was able to do this: You can download my workbook here.
Be advised though, I feel there would probably be a simpler way out there to do this.
What I did was to create 2 calculated fields.
'ValidComponentCount': IF ([Component Type]='Valid Component') THEN 1 ELSE 0 END
'% of Valid': {FIXED [Rootname] : SUM([validCount])/COUNT([Number of Records])}
Then sorted the 'Rootname' column based on descending value of the 2nd calculated field (% of Valid).

Get conditional mode efficiently in Excel

I am looking to find the mode (most occurrent) value of one column, given another column.
I know how to do it but the calculation takes multiple minutes and can make Excel unresponsive. Therefore I am looking for a better way.
Suppose my data looks like this
group | Level
1 D
1 A
1.1 B
1 C
1 A
1 E
Then I want the output to look like this:
group | LevelMode
1 A
1.1 B
Assuming the data is in the upper left corner of the worksheet, I am now using this formula, which I drag along the C column:
=COUNTIFS(A:A;A2;B:B;B2)/COUNTIF(A:A;A2)
This gives me the ratio of values within the group. Afterwards I remove all that are not above 0.5 as well as duplicates, giving me the mode for each group if it exists.
This formula does exactly what I want, but for about 50000 lines it simply takes too many resources. I expected to find this in the pivot table options, or after a quick search online, but I have not found any way to achieve my goal.
I have decent hardware, a fairly recent version of Excel and would prefer to do this without macro's. However, if macros are required to achieve this then so be it.
Try this:
Step 1.
Create the Pivot Table and place in RowLabels "Group" and under it "Level". Now, place "Level" as count in "Values" field.
Step 2.
See the picture below. Click in the black arrow in the right side of "Level" (you can't see it in the picture but it is supposed to be inside the red circle).
Choose "Values Filters", then "Top 10" and then set the number to 1 (top 1). Done!!
Attention: you need to do step 2 for "Level". If you do the same to "Group" it will not work.
Edit: this is the result and how the Pivot Table should look like.
Now to shape the output to the desired format:
Under PivotTable tools > Design, set the Report Layout to Tabular form
Disable totals and subtotals
Assuming default settings you can now easily copy the list of Groups and LevelModes

Google Spreadsheet filter

I'm trying to filter a list of employee by department in google spreadsheet
=filter(A:C,!B2:B6=D2)
my sample data is
Name Department age
asd dep1 12
fds dep2 2
plo dep3 3
sdfsdf dep1 56
shg dep2 98
now I already got the filter part working.. my question is after filtering. how can I tell GSpreadsheet to only display specific column values... like use department as filter condition but only return name and age?
eventually I also want to move my result to a different sheet.
My first choice of approach for this issue was to use google macro like thingy and just hide the rows and comlumns not needed if you have suggestions for this please don't hesitate to provide.
The easiest way to filter is the [Data-Filter], otherwise [View-List] is also able to filter. Using a formula you will be displaying the results in a different column, usually on a different page.
My suggestion to omit column B would be to make two separate column filters like this:
=filter(A:A,B:B=D2)
=filter(C:C,B:B=D2)
The exclamation is only necessary if you are on another sheet, you may also be trying to do something like this: filter(A2:A,B2:B="dep1") the real power of the formula is where you want to manipulate the value before your comparison like this: filter(A:A,right(B:B,1)="1") otherwise I'm not sure what you are referring to, other than Google Apps Scripts I am not aware of any functionality very similar to VBA.
If this did not answer your question can you be a little bit more specific?
I would use the QUERY function here:
=QUERY(A:C, "select A,C where (B = 'dep1')")
This will return with two columns (Name and Age - that is "A" and "C" respectively). The filter condition is provided in the WHERE clause.
For moving the result to another sheet, I would do it another way around: Create another sheet, and then write:
=QUERY(employees!A:C, "select A,C where (B = 'dep1')")
Assuming that your original worksheet's name is "employees".
I hope it helped.

Resources