How to select one value to be displayed in SPSS to be displayed as chart - charts

I have two variables Career and Internet usage, there are two career options but I only want to select one value.
When I generate the pie chart in the output window I get and overview of internet usage but it includes both of the careers I only want a specific career to be shown in the pie chart e.g
How do people from System engineering use the internet as opposed to how does everyone use the internet
I don't know if this is clear, but if it is how would I do this in SPSS? is there some sort of filter_?

For one chart you can use TEMPORARY followed by a SELECT IF. If the the chart command follows directly after it will only plot that subset.
DATA LIST FREE / Career Internet.
BEGIN DATA
1 1
1 2
1 3
2 1
2 2
2 2
END DATA.
VALUE LABELS Internet
1 '2-4 Hours a Day'
2 '5-7 Hours a Day'
3 'Over 7 Hours a Day'.
TEMPORARY.
SELECT IF Career = 2.
GRAPH
/PIE=COUNT BY Internet.
If you have multiple charts see the FILTER command.

Related

Power Bi Clustered Column Chart to show % or row total

I am using Power Bi to produce several reports, one of it is the NPS score for support. However, I am coming across an issue with the clustered column chart. It is showing the value against the total number rather than for each row.
What I want to see if the following (within Excel),
The NPS score is shown as a percentage for each week.
e.g. Week 3 has the Promoter at 95.5% and Detractor at 4.5%
However, when using Power Bi, I am shown the following, which is a Percentage of the grand total, instead of each week.
Using a Matrix, I could see the following as total numbers.
I can copy this Matrix and show it as a Percentage of each Row, which is also correctly showing the results.
I have the dates already set up using a feeder table to allow me to get the week number etc from a date within the main raw data, so they sort in the correct order..
My Chart is using the following table entries
Cal Week and WeekNo are both from the feeder table (Fiscal)
Net Promoter and Count of Case Num are from the RawData table.
How can I get the chart to show the percentages per week instead of the total?
I am also planning to use slicers to filter down further, for example, Regions (which are in the RawData).
I believe I will need to add an extra column to the RawData, but no idea what to put in it and then how to use that in the chart, and still allow it to slice.
Any help would be greatly appreciated.
Thanks
DD

Campaign analysis in Tableau

I am doing campaign analysis and the objective of campaigns is to convert lead into customer. I want to see how many leads are exposed to how many campaigns in terms of percentages before they convert to customer.
Below is the sample data where there are four unique lead.
abc has seen three campaigns, efg has seen two campaigns and so on and so forth
I want to show in pie chart may be something like below in tableau where out of 4 leads 2 leads has seen 1 campaign each so 50%, 1 lead has seen 2 campaigns so 25% and 1 lead has seen 3 campaign so another 25%
First of all you have to find how many campaigns have been exposed for each Lead, Count Campaign:
{ FIXED [Lead id] : COUNT([Campaign])}
Since you want to breakdown your pie with this value, you need to convert this calculated field into a dimension.
In order to calculate the % you're looking for, you need just an additional step; Metric:
COUNTD([Lead id]) / attr({ FIXED : COUNTD([Lead id])})
Doing so you're going to compare each value to the total distinct value of your Lead (4)

How to get three measures in a single chart?

I want three measures in a single chart.
Time spent by an employee in the office. (Available hours)
Time spent by an employee on productive tools. (Productive Hours)
Percentage of time spent productively. (PH : AH %)
I have used dual axis for 1 and 2 as 2 will always be less than 1.
I want it to look something like this
The problem is when I use blended axis it does not show the "tools hours" as a part of "available hours". So for example if an employee was available for 5 hours out of which he worked on productive tools for 3 hours the blended axis will show total available hours to be 8.
Your available hours is aways greater than your tools hours?
So, you should use a calculated Field where you show the tools hours and the "available hours" - tool hours.
It can also be solver by transforming your data source input.
PS: Yes, you can make formulas (calculated fields) across joins and blendings.

Tableau: graphically show compounded leadtimes

I have a chart that shows the number of departures for a given 15 minute interval as seen here.
I need to compound these counts backwards for one hour. For example, the 3 departures shown at 11:00 need to also be represented at the 10:00, 10:15, 10:30, and 10:45 columns. When completed, the 10:00 would have a total of 6 departures (10:15 -> 6, 10:30 ->5, 10:45 -> 4, 11:00 -> 4).
I have done this via VBA in excell, but am now needing to replicate the chart in Tableau and have been beating my head in for about two weeks now. I'd love to hear any and all suggestions.
You can use a Cartesian join against a large enough date range of your choosing to in effect resample your data and add the additional time intervals you desire.
For example, if you have a month's worth of data (min date -> max date = 30 days), then you have (30 * 24 * 4) 2880 15 minute intervals.
Create all those intervals in a separate data sheet
Add a bogus column with value of link for all rows
Create the same bogus in your actual data source
Join the two sheets together on the link column
Create a calculated field that is something along the following:
[Interval] <= [Flight Time] AND [Interval] >= DATEADD('hour',-1,[Flight Time])
This calculated field will evaluate to TRUE when the interval time is within one hour before the flight time. You can then drag this field onto your filter shelf and select TRUE value only. Effectively your [Interval] field becomes your new date field.
I would recommend adding that filter to the context and applying across the entire datasource. Before you add this filter you'll have 2880 times the about of data so be sure to do a live view first. Be careful with extracts using Cartesian joins as you could potentially be extracting more than you bargained for.
See the following links for different techniques on how to do this and re-sampling dates in general in tableau.
https://community.tableau.com/thread/151387
Depending on the size of your data (and if a live view is not necessary) it is often times easier and more efficient to do this type of pre-processing outside of tableau in SQL or something like python's pandas library.
Here is another solution provided from the Tableau Cumunity Forum. I have not tried tyvich's solution yet, but I know this one got me where I needed. Please follow the link to see the solution using moving table calculations.
https://community.tableau.com/thread/251154

How to I get the running total from a graph?

Im working with SSRS 2008. I have a bar graph showing me the defect counts. I am showing them with ranges from days to weeks or even months. Above it I want to show how many defects are actually being shown. For example if I show a range for two days. On day one there was 3 defects. Then on day two there are 2 defects. As you can see the total is 5 defects over the two days. What expression could I use that will bring back this value?
Thanks in advance
Zack
You can use RunningValue in your Value Expression:
=RunningValue(Fields!DefectCount.Value,Sum,"YourDataSetName")