Scenario:
90 days of sales data grouped by sales person from a stored proc.
Tablix:
A single summary calc e.g. Gross Profit achieved for 30 days (sales-costs=GP)
Sparkline:
A sparkline showing GP Acheived each day for 90 days.
Question:
How is this done in SSRS?
Many thanks in advance for suggestions and advice.
Assuming your dataset looks something like this:
SalesPerson Day Sales
Person1 Day1 10
Person1 Day2 15
Person1 Day3 40
Person1 Day4 20
Person1 Day1 10
Person1 Day1 12
You can create a matrix report like this image:
The row grouping is on SalesPerson (Employee)
The column grouping is on Day ( so will repeat for each of 90 days)
Drag a sparkline object into the last column. The trick is that you can't add a sparkline to a details row. If you need to you can change the details group so that it groups on something that differs in each row (effectively not grouping at all).
Set the sparkline properties like this :
So that Day is in the categories and Sales values is in the SUM Values.
Done! Easy :)
Related
I have a business requirement to show the trend of cumulative percentage of an atribute over last 2 years. I used a measure to create running total of the attribute for this year and the results are correct.However When I tried to apply the same logic for the past 2 years it is giving me incorrect values.I have created a date table that spans from 2021 to 2023 dec and The X axis of the chart displays weeknumber.Could some one help me with this issue?
Thanks in Advance!
The measure for this year :
Cumulative2023 =
CALCULATE(
DIVIDE(
'Table'[CY CountNum2023]
,'Table'[CY CountDen2023]
,0),
FILTER(
ALLSELECTED('Table'),
'Table'[CreatedDate] <= MAX('Table'[CreatedDate])
)
)
I would like to ask how to create the sequence formula in order to repeate a date 10 times and do it for the whole year.
For example starting from 01/01/2022 to copy this date 10x then for 02/01/2022 to copy it 10x and so on. I started to use following formula for sequence:
=DATE(SEQUENCE(10,1,Year(B1),Month(B1),day(B1))
where B1 is 01/01/2022 and day and month are copied 10 times but the year is changing. Is there a way to do it to have the year same as well?
Thanks in advance.
You can take advantage of the fact that a date in excel is, conveniently, an integer number, and do it like that:
=INT((ROW(B1)-1)/10) + $B$1
That'll repeat the date entered in B1 10 times and than switch to next day, using the row number as a guide (so if you are not on the first row, you may need to add + X to the formula, where x is the row offset).
(Actual raw integer shown in D column for illustration, repeating every 3 rows instead of 10 to keep the screenshot smaller)
I have student data classified as per the year of enrollment and semester. For calculating retention rate, I need to divide all retained students for CY by total count of PY. How should I create a formula for that?
Your code will look something like this
Calc 1
IF Year = 2021 THEN Amount END
Calc 2
IF Year = 2020 THEN Amount END
Then you do Calc 1 - Calc 2 in another calculated field. Or you can also use lookup function if it is a table calculation
Lookup Function -1
I have a data set like this
Name Occupation Payment Principal Interest
Amy Nurse 100 90 15
Becky Teacher 80 100 20
Catherine Nurse 90 75 15
John Engineer 90 80 12
Tom Teacher 120 100 20
... ... ... ... ...
I'd like to create side-by-side(Payment) stacked chart:
Row: Occupations
Column1 : stacked(Sum of Interest and Sum of LP Principal) by occupation
Column2 : Only Sum of LP Payment by occupation
Can anyone give me hint how to make it?
Your data is not in the correct format for the required chart and you need to do some data prep.
Pivot all three measure fields from the data source page.
create a calculation to define the column for each data type
Build the chart as below and hide the header for column field.
One approach that avoids reshaping your data is to use the measure names and measure values placeholder fields to create the stacked bar chart.
See below
Original post - https://community.tableau.com/thread/206909
I have a report in which I have sales per month in the column and commodities in the row. The data show actual sales and future estimates for each month.
Need to calculate Year-To-Date (YTD) total for 2016 (from Jan to Previous month) and have it in a single column at the end of the actual values.
I already created a calculated field - YTD
IF
YEAR([DATE]) = YEAR(NOW())
AND
MONTH([DATE])< MONTH(NOW())
THEN
[VALUE/UNIT]
ELSE
0
END
But when I add to the view, it creates a another section for YTD with sum for each month till April.
Can someone please help me in how to achieve this in Tableau?
There are couple of ways to achieve this view in Tableau
1. To create calculated field for each Month and YTD and add measure names in Row & Measure values in Text
2. Make union of 2 queries - one that select all the correct values & second that have YTD calculation in month column. Then use pivot it