GROUP BY using spotfire - spotfire

I am using Spotfire to build a line graph. The data set consists of the following fields:
Requirement Project Name Period Score Project Spend
Req 1 Project 1 3/1/2016 2 750000
Req 2 Project 1 3/1/2016 3 750000
Req 3 Project 1 3/1/2016 2 750000
Req 4 Project 1 3/1/2016 2 750000
Req 1 Project 1 6/1/2016 2 750000
Req 2 Project 1 6/1/2016 3 750000
Req 3 Project 3 6/1/2016 2 500000
Req 4 Project 3 6/1/2016 2 500000
In the line chart, I have Period on X axis and I need SUM(Project Spend) by Project on Y axis.
For example:
for 3/1/2016 on X axis, the value on Y should be 750000 as only one project is active (Project 1)
for 6/1/2016 on X axis, the value of Y should be 750000 + 500000 as during that period two projects were active (Project 1 and Project 3)
Can someone help me with the Y axis formula to get the desired output?

If the value in project spent is always the same. You could do the following:
This only works with a bar chart though and not with a line chart. A line chart separates the lines so it won't add the values, even if you aggregate it by summing it up.
X-axis: [Period]
Y-axis: Max([Project Spend])
Color: [Project Name]
Alternatively, you could aggregate it by using a SQL Query if you fetch your data from a database.

At first you need to add a calculated column to keep only one row per project:
[unique spend]: If(Min(RowId()) OVER ([Project Name])=RowId(), [Project Spend], null)
Then create you line chart and use this expression for vertical axis:
Sum([unique spend]) over (AllPrevious([Axis.X]))

Related

Add horizontal axis per series in excel

How frustrating is Excel.. working on this for half an hour now.
I simply try to make a frequency plot of two groups, with different colours. On the x-axis I would like to display the subject.ids per bar.
However, if I select a different range for the horizontal x axis per series (series 1 = blue, series 2 = orange) with the subject id, it changes the x-axis in the other series to the same. What in hell am i doing wrong?
3007 1
23121 1
3009 1
3005 1
3011 2
23171 2
3207 2
3102 3
3207 6
13302 7
2411 11
23191 11
3008 11
3106 12
110031 1
110031 1
110030 1
110017 1
110014 1
110008 1
110004 1
110007 2
110035 4
110020 4
110003 4
110036 10
110019 11
110015 21
AFAIK, you cannot put 2 series onto the x axis.
You have 2 alternate ways to solve your problem:
Concatenate each positional pair into a new column and use this as the x-axis label series. It will look like this:
You could use data labels for each series. However, this will add the data to the columns themselves and not the axis (you could put it at the base of the column). To do so, you will need to right click on the graph, select 'Add Data Labels'. By default it adds the value as the label, but you can select the labels, right click to format the data labels and use the 'values from cells' option. Once you do this and play around with the orientation and location of the labels, it will look like this:
For simplicity, I'd go with the first method
Adding a 3rd option; simply put the columns for the axis labels beside each other and when selecting the Data for the Axis Labels, just select both columns instead of the usual 1. It will look like this:

Excel rotate radar chart

I have been trying to create a windrose that displays the occurence of multiple wind speeds and their respective wind direction. Using other very helpful posts on here I've gotten pretty close to what I want. There is just one thing I can't seem to fix.
As you can see in the figure below the graph starts at 0 degrees while I want the "North" wind direction to start at -11,25 (or +348,75) degrees.
Currently the radial axis labels are added using a pie chart while the rest of the data is plotted in a filled radar chart. It is easy to rotate the pie chart but I can't seem to find a similar function for rotating the radar chart. Any help would be much appreciated. The excel file is attached beneath the figure.
EDIT: Locked excel file against editing
Excel file
I haven't fully digested the netiquette of this website and not sure if it is a good idea to try giving you an answer 6+ months after you posted. Also hope that by this time you found an answer.
If not, this link should be of help:
https://superuser.com/questions/687036/how-to-make-a-pie-radar-chart
In the example the creator made one field for each degree and started the first series, which would be equivalent to your north at 0°. However nothing prevents you from starting at 348.
I have not tested but I also think that nothing prevents you from adding even more "resolution", e.g. half-degree steps.. or even more to your discretion.
EDIT: following L.Guthardt's feedback.
In order to provide you an answer I opted to simplify your table and chart. Mostly for convenience, but also because I struggle to get a full understanding of the original "architecture". Still, the solution should work at any level and is based on two key elements:
first you will have to double the number of rows from 16 to 32 (thus each quadrant being repeated two times, e.g. ... nne - nne - ne - ne...)
second, you have to start and finish with N as showcased here
Direction Cat6
N 6
NNE 4 4
NNE 6
NE 4 4
NE 6
ENE 4 4
ENE 6
E 4 4
E 6
ESE 4 4
ESE 6
SE 4 4
SE 6
SSE 4 4
SSE 6
S 4 4
S 6
SSW 4 4
SSW 6
SW 4 4
SW 6
WSW 4 4
WSW 6
W 4 4
W 6
WNW 4 4
WNW 6
NW 4 4
NW 6
NNW 4 4
NNW 6
N 4 4
which will generate
for the pie chart I used a separate range with alternate gaps in the labels
Direction Dummy
N 1
1
NNE 1
1
NE 1
1
ENE 1
1
E 1
1
ESE 1
1
SE 1
1
SSE 1
1
S 1
1
SSW 1
1
SW 1
1
WSW 1
1
W 1
1
WNW 1
1
NW 1
1
NNW 1
1
Rotating radar charts in Excel can be achieved by building a separate table for plotting the chart. It would have three columns:
Column A: New categories
Column B: Original categories (calculated from A)
Column C: Original data using VLOOKUP() on B
The chart will be plotted using columns B and C. Column B category numbers are offset by the desired number of categories.
If the chart needs to be rotated by other than multiples of a category degree (e.g., 30 degrees for 12 categories), you would need to add rows in between (corresponding to the amount of rotation in relation to the category degree). For example, to rotate a 12-category radar chart by multiples of 15 degrees, one extra row is needed in-between each original category row (to create 24 new categories). In this case, you would need to calculate the intermediate values by linearly interpolating between actual data points.
The trick is that blank category values are not displayed on the chart and the values for these categories blend in smoothly with the real data (because they are interpolated).
I will post an example if the above is not clear enough.
P.S. I cannot look at your new Excel file (in Answers) because it exceeds 5 MB (see screenshot 1).
So I did keep working on this problem and the best solution I've come up with (while using Microsoft Excel) looks as follows:
Currently, the number of sectors in the plot is fixed at 16. If I want to make this number variable, the table required for the plot data requires a very large amount of lookup functions which make the spreadsheet too slow to work with.
I've uploaded the new Excel file here to take a look at:
Excel file

How to make PivotChart with line breaks

I have data like the following:
x y f
1 1 1.2
1 2 1.4
1 3 1.6
3 1 3.2
3 2 3.4
3 3 3.6
5 1 5.2
5 2 5.4
5 3 5.6
If you insert a pivot chart, you can plot f vs x and y using a line chart, and the plot has two stacked x-axes where the lower x-axes values are 1 3 5 corresponding to x, and the upper x-axes has values 1 2 3 for each value of the lower x-axes, representing x = 1 and y = 1 2 3, then x = 2 and y = 1 2 3, and x = 3 and y = 1 2 3. The plot should show a single continuous line from left to right. What I would like is for the line to break when x changes values, so there are three short lines showing the influence of y for constant values of x.
This link makes a chart similar to what I'm describing in the answer. In terms of that figure, what I want is for the link to break every time the year changes. But the answer they have, and discussion doesn't get what I'm looking for. The only approach that I can think of is to modify the PivotTable data by hand and add a row at the location the data breaks. I tried to do something like that at work, but before modifying the table, I copied the table as values to a separate location. With the new data table, I was not able to create the plot with two x axis. If I created the plot, I could put a second value in when y = 3, and for f have NA(), which should create the break in the proper location.
For something that looks like:
Select each of the second and subsequent y 1 values (individually):
and Format Data Point..., Line, No line.
(BTW IMO better suited to Super User.)

Show sales figures over time per employee

Assume the following data:
day employee sales
1 a 0
1 b 10
1 c 10
2 a 5
2 b 7
2 c 10
3 a 3
3 b 3
3 c 5
I would like to have a chart with on the x-asis the days (1, 2, 3) and on the y-axis the number of sales. Each employee should have its own line, so they can be compared.
I am unable to get a chart like this. I expect to get 3 lines when selecting all data, but Excel returns 1 line per data-row instead. It does not, so to speak, group the sales by employee. How can I get the chart I want? Is it even possible?
Any help is greatly appreciated :-)
Have you tried a pivot table or pivot chart? Just drop your employee name in your row section, sum your sales, and I think that's what you're looking for.

Excel - bar graph over time

I have data as below:
t1 t2 t3 t1 t3 t4
case-1 3 3 3 1 2 1
case-2 3 4 3 1 2 1
t1,2,3 and 4 are kinda activities over time and the number indicates duration.
I tried to draw "100% Stacked Bar" graph. But, a problem is columns with same activities such as 't1' and 't3' are recognized as different columns/activities, which are needed to be same legend and color. I just want to draw a time frame-based activity bar without duplicate legend properties.
Do you have any idea?
Thanks!
Here is one idea, though applies a Stacked Bar chart:

Resources