Limit text in SSRS Report Table - sql-server

Background:
I have a table with say 40 columns reporting Employee Details. Where 39 of 40 columns are of Datatype varchar(10) and the 40th column, being Manager's comments, is of Datatype varchar(1000).
Problem:
The report is looking bad as due to one column the height of the complete row is increasing than normal expectation.
Solutions I thought of:
Increase width of column > Looking bad if no comments
SubString the data coming > Loss of data
Set CanGrow to False + set the Height for Row to have 2 data lines + Show text on tool tip + Export to excel link of a different report which has CanGrow as false > not very good solution
Can someone suggest a better way to handle one column with more text than the rest of them as even my 3rd approach is looking non-ideal to me?
Thanks in advance.

A little unconventional, but in situations like this I've put the last column in its own row beneath the other columns, merged all the cells in that row, and then grouped by the primary key. That makes a report in which you've got a two row SSRS group for each row in your query results, the first row contains all of the short columns and the second row contains just one long column. If there is a fairly short string in that last column, or an empty value, it will just take up one row. If there is a long string, then it will have space to expand vertically (if CanGrow=True), instead of expanding horizontally and making an impractically long report.
This may not meet all reporting purposes, but if the report is intended for visual use it can work well.

The best solution I could find was
Set CanGrow = False
Increase Width and set a generic Height
Show tooltip
Export to excel works fine and shows data unlike I expected (as the data is not truncated but just the textbox is restricted to show data in SSRS frontend)
This works for me as there is no data loss.

Related

Google Data Studio piechart from column with multiple values per cell

I have an excel spreadsheet from a Questionnaire. One of the questions was in checkbox format. The result of this question are held in a single column, and where the user has selected more that one answer, the answers are separated by comma's.
What devices do you own? Mobile, PC, Laptop, Tablet
So in a single cell I get 'Mobile,PC' when these two are selected.
I am using Google Data Studio to visualise the data, but stuck on how to create a graph that shows all the values individually.
At the minute I get a combination for every value. So a value of 1 for 'Mobile,PC' rather than a value for 1 'PC' and '1'Mobile.
Google Data Studio doesn't allow countif statements, so a bit lost.
I have tried to TRIM, COUNIF and REGEX but none have worked.
Count(REGEXP_MATCH(Device, "PC"))
I'm a bit lost on this, tried so many combinations. If someone can put me on the right track I would be very grateful
I don't think you'll be able to achieve that with a pie chart without changing your data source first as it needs one dimension (Device) and then one count metric which your data doesn't seem to support.
You could create 4 metrics like
SUM(
CASE
WHEN REGEXP_MATCH(Device, "PC") then 1
ELSE 0
END
)
And put them into a Stacked bar / column chart. You might need to create a dimension that has a single value to avoid having multiple bars/columns.

How to count unique occurrences with criteria in excel

I'm using the below array formula to count the unique occurrences of text in column C using the agent name in column G as the reference. This is giving me multiple issues.
=SUM( --(FREQUENCY(IF(G3:G100000 = J5,MATCH(C3:C100000,C3:C100000,0)),ROW(C3:C100000) - ROW(C3) + 1) > 0))
Depending on the data set I'm using multiple agents will return a #N/A result and I can't figure out why.
Each dataset I'm using is 20k to 30k lines, so the formulas take a long time to process.
Any ideas how I could do this faster or better? Also any ideas why some agents get bad returns?
I am assuming that you are looking for the number of unique combinations of columns C and G.
Create a pivot table and check the box to add this data to the data model.
Drag both column headers to the Rows section, also drag one (of those same two) into the the values section.
click on the the field in the values section > value field settings > summarize values by > choose Distinct Count. This removes all duplicates.
Click the Row Labels filter and uncheck the blanks.
You can drop in new data then right-click on the pivot and refresh to see the new results. See the image.

Why do I see "Blank" or "0" value at the begging of Stacked Column Chart in Power BI Desktop

For some reason stacked column chart displays "Blank" value even though data behind doesn't have any Blank or '0'.
And my X-axis doesnt have "Type" where I can choose between continuous or categorical:
In a data behind I have 12 months, no blank or 0 :
The (Blank) value can occur even though your underlying data set has no blank values. It is because when you have established relationship between tables, and there are other visuals or filters on the same report page, leading to a joining or filter which results in blank values.
It can be hard to pinpoint sometimes, so the easiest thing you can do is to filter it in the Visual level filters as follows:
As for the X-axis continuous or categorical type setting, it is only available when the data type is numerics or date/time. The MonthShort column you're using is just text to Power BI and it has no idea in what way it should be continuously linked. You need to use the MonthNumber or a date column if you want to achieve so.

SSRS Conditional Expression

In SSRS report, I want to perform conditional color formatting where highest rank should be Green and lowest rank should be Red within a Regional Manager group as shown below
Note: Couple of options, I was thinking of includes
I am using custom code function, for deriving Min and Max value, and somehow if I can include grouping filter on Regional Manger then it could work, but don't know if that's possible
In dataset, I create extra columns for each column and store Min\max value in it. But less keen towards this option, since I have 24 different ranks and which would mean, I will need 24 different columns along with current 40 attributes
Any help would be appreciated
I know you don't want to do this for each column, but despite your misgivings it is probably the best approach. Based on my previous answer to your earlier related question you can colour the min and max for each group as follows.
Create a table with fields store, atvrank, and btvrank
Right click the row header, and select Add Group -> Row Group - Parent Group, and choose Regional Manager. Set the Group name to RegionalManagerGroup
Then set the background colour for your cells to
=iif(Fields!atvRank.Value = min(Fields!atvRank.Value, "RegionalManagerGroup"),
"Green",
iif(Fields!atvRank.Value = max(Fields!atvRank.Value, "RegionalManagerGroup"),
"Red",
"White"
)
)
This now finds the maximum and minimum within the current group instead of the whole dataset. You will need to set this expression for each field individually, but this is probably less effort than returning new rows from the database to determine the maximum and minimum for each field.
This approach will give the following output
Please seriously consider this solution. If you have further questions, please just ask.

Excel - find value in row which is not an error or blank

Someone posted a question about doing this for a column but I don't understand the answer well enough to tweak it to work for data in a row. Can someone help me understand how this formula works and how to apply it to data in rows? I want to display the non error value in a new column, not the number of the row or column.
Thanks!
Try this formula
=LOOKUP(2,1/(A1:A100<>""),A1:A100)
extend range as required. In Excel 2007 and later you can use the whole column
Original question here: Excel - find last value in a column which is not an error or blank
=LOOKUP(2, 1/(A1:G1<>""),A1:G1)
Just change the range in both places.

Resources