SSRS 2012: Sparkline Chart Per Every Details Row - reporting-services

I have a stored procedure that returns data in this format:
Location MorningSales NoonSales NightSales
A 12 6 32
B 20 43 12
I have my table displaying the above data in details (not grouped) format. I now want to add a sparkline at the end of each row, using the numbers in those three fields.
They should look something like this:
I just cannot for the life of me figure out how to setup category groups for each field.
I was able to have this result before by bringing in the data as multiple rows for each Location, i.e.:
Location SalesTime SalesCount
A Morning 12
A Noon 6
A Night 32
B Morning 20
B Noon 43
B Night 12
But for the purposes of speed, I had to pre-calculate my sums and avgs in a stored procedure, since SSRS seemed to take forever and a day to render the report when it calculated the aggregates itself.
Is there any way to pull off what I'm trying to do here?
I think my question is similar to this one:
SQL Server Business Intelligence Studio: Line chart from single record
The accepted answer there is to rewrite the sql query and end up with something similar to the second dataset I showed here. If it can't be done any other way then fine, but I don't mind hacking and rigging to make it work for my situation.

Hope below link helps you in finding the solution:
http://www.sqlcircuit.com/2012/11/ssrs-how-to-add-sparkline-in-tabular.html

Related

How to count a range of values in datastudio

I am trying to transform a report that I have made in sheets into the newest datastudio tool. In my sheet, I have a table where there are several columns that holds data related (this is because each row could have more than one value so I used the "split text into columns" function to represent).
What I have is something similar to:
ID
Component
Component 1
Component 2
101
wood
metal
gold
102
metal
copper
103
wood
gold
metal
In my excel, I have a formula to count the time a certain component is shown by using =COUNTIF(<range>,<string>)
Therefore, with the above formula, I have something similar to:
Component
count
wood
2
metal
3
copper
1
gold
2
I want to be able to build the same in datastudio. Turns out that since the components are divided into columns, I can only use one dimension and the result only shows the count of the first column.
I want to know if there is an easy way to accomplish this. My original data source is like this:
ID
Component
101
wood;metal;gold
102
meta;copper
103
wood;gold;metal
Maybe it's easier to work directly with the previous format but again, using the component in this case only counts for the first occurrence and not across the whole string.
For now, the only solution I can think of is splitting the text into rows instead of columns, but that is not feasible achievable using Google Sheets, or at least not that I am aware of.
Could somebody have an idea of how to accomplish this?
Thanks!
Edit
I am adding here the minimal reproducible example. This is the spreadsheet that I have (example) and the current report I am using so far (built-in sheets):
Now, I want to have the same report (plus more things) using datastudio. This is the report example I have in data studio. As you will see the record count for components is not accurate in DataStudio.
Here is a preliminary answer. I'll polish if we like it and delete it otherwise.
Consider the following sheet:
Range A2:B4 contains my data of interest. Rows 7:10 show the results I think you are looking for. The mechanism for creating this is the value of cell A6 which contains:
=ARRAYFORMULA(QUERY(FLATTEN(SPLIT(B2:B4,";")), "SELECT Col1, COUNT(Col1) WHERE Col1 is not null GROUP BY Col1"))
At the highest level, the formula splits each of the delimited text items into their own cell and then flattens all these cells into one column against which we then run a SQL query against the sheet to group and count them.

PowerBI gives different results than MySQL. Can someone help me?

When I use COUNT in MySQL, for example, Mrs. Aretha Salas gets 18 movies, but in powerBI, using COUNT says 20 movies. 18 movies is the correct value. How do I get this resolved?
In MySQL
In PBI
In PBI
For Power BI to be coming up with a different figure, there will be a join to another table or a second row (possibly duplicate) in your film table increasing the count.
Brake the table into a separate Power BI workbook and perform the same test. If you are still getting the same result in your new workbook, turn the visual into a table and that should explain how the count is coming out incorrect.

SPSS changing count totals

I am running crosstabs from a survey in SPSS - Layered 2 independent variables on one question (the dependent variable). There are 1000 responses total, but whenever I run the crosstab it returns the data with 1001 or 999 or 1002 responses total. I have tried using both the Custom Tables feature and the Descriptive Crosstab feature. Neither will give me the correct totals, and all of the counts are just barely off. Is this a common problem? How do I fix it? Thanks in advance.

Report builder 3.0 Using Reportitems!TexboxXX.Value sometimes creates multiple boxes. Why?

I have 6 Datasets each one is the same query but has a different WHERE clause based on employee type. They generate 6 tables. At the top of the report there is a summary table which uses reportitems!textboxXX.value to grab the totals for 2 particular fields from all the tables. I'm also using a StartDate and EndDate parameter. Each reportitems! expression in the table comes from a different dataset in the report if that is relevant.
When I run the report using dates from yesterday back to the 9th of May I get the desired output.
But when I go to the 8th I get multiple rows all the same.
and as I go even further back I get even more rows of the same information. To my knowledge nothing interesting or different happened on the 8th of May and the tables further down the report look exactly the same. Any idea what might be causing this? The design view looks like this if that helps. There's no grouping or filters on the table.
Still not certain about the mechanics behind this but I found a 'solution' so I figured I'd post it. I just made a new dataset for my summary tables where the query was simply SELECT 1. Now I get a single row every time.

Monthly columns in SSRS 2008 from Fetch XML

I have an annual report where I want the months to be displayed in columns Jan-Dec, even for the months that don't have any values.
Today I have a matrix report that starts on May as that month is the month with the first values. But I want the tables to start on January, even if there are no values for that month.
I also wonder if I can have several rows in the same matrix but with different data sources (XMLFetches).
I'll explain a bit more. Really ought to be a fairly simple raport where I want to show how much is sold on a monthly basis and each month is a column and the rows are the products.
i'm using a fetchXML from CRM 2011 on-line.
Month jan feb mar apr may jun jul
Wheels 0 0 0 0 10 65 75
Cars 0 10 0 10 0 100 175
It's not possible to combine different datasets in the same matrix on the report, however, you can combine datasources to create one dataset before presenting the dataset to a report. For example you could use a stored procedure (or SSIS or powershell etc) to read from the database and combine the data into a table, temp table, table variable in the database and then query that from the report - or in the Fetch XML
To get a report that shows calendar entries even for entries that have no data you need to start with the calendar you require and then left-join it to your actual data.
If you are doing this from dynamics CRM and are familiar with editing the FetchXML yourself then you can join data from multiple entities using the with the as appropriate. This other article on stack overflow details that technique: Left join in FetchXml?
For example, if your report has just the months, you could create a calendar table with 3 columns, Year, Month and MonthNumber. The MonthNumber is important for sorting months in the report because you can't order months alphabetically. If you only ever show a single calendar year on the report then the year column might not be necessary but this is something you can reuse for many reports so it's worth doing properly. If you want to read more about them, look up "calendar table", there are many opinions on how to create them, but maybe start with a simple one to get comfortable with the idea.
If you left join the calendar table to your month data, you will get NULL values for the months January to April (because your data starts in May) and you may want to replace these NULL values with 0 or an empty string, depending on what is appropriate. Using isnull() or nvl() or whatever the appropriate function is in your database could be appropriate there.
The answer to how I built the sorting on month is that I used parameters to build up the month-year value for a specific column that I then use to compare with the month-year-value from the fetch.
In the column
=Sum(Cint(IIF(Fields!startmonth.value=Cint(Parameters!year.Value & Parameters!jan.Value),Fields!money.Value,0)))
So the month-year-value from the fetch is via a calculated field built up to e.g. 201302 and that is then compared to the selected year 2013 and added the monthvalue for that specific column 02=201302.