Spotfire DenseRank + Filters - graph

I'm trying to make a dynamic top 3 line graph that responds properly to filtering (and maybe marking too). I currently have line by:
<If(DenseRank(Sum([Timesheet].[Hours]) OVER ([Timesheet].[Team]),"desc")<=3,[Timesheet].[Team],"Others")>
I'd like it to show the top 3 lines for data available after filtering instead of top 3 for the table regardless of filters. As is, it may show no lines at all if the top 3 for the entire table are not part of the filtered data. No matter the filter I'd like to see 3 lines.

Related

Anylogic: How to create an agent graph in the Main agent?

In my Anylogic model I have an agent population (terminals) of 4 agents with the time measurement shown below. I want to make a graph of this end.distribution.
If I create a graph in that agent tab and run the model, the graph will always appear within my GIS Map in the Main agent, which makes it unreadable. Thus, I want to create the graph within the Main agent tab. However, when I make the graph in the Main agent with this histogram data: terminals(0).end.distribution, I receive this error: Index 0 out of bounds for length 0, while there are 4 agents and this reference to terminals(0) does work in a tab of another agent population. Does anybody know how to make it work?
Your issue is an initialisation-order one: your histograms initialises themselves before the embedded agents they are referring to for their data are created (and so you get the error).
There are various ways to control the initialisation order but the 'correct' solution here (irrespective of initialisation order) is to use a replicated Histogram chart, where each replication 'links' to the appropriate Terminal agent to get its data (and so will only exist when the respective Terminal agent exists in its population).
This also means you only 'code' the histogram once, and it will dynamically adjust to create as many histograms as you have agents (which is what you would typically always want).
(The expression for the X coordinate of the replicated chart will depend on how wide it is. In my case, the chart is positioned at x=40 and is 300 wide, so I make each replication 350 apart to leave a 50 gap between.)
See help section AnyLogic Help > 2D and 3D Animation > Shape Replication for more details on replication (a very powerful capability applicable to several different types of element).

Combining 3 charts into 1

How can I combine the 3 charts into 1 in Data Studio?
I'd like the left hand axis to be number of users, and right hand axis to be %.
Also, after combining all 3 charts, can I still include a reference line? (I'd like the reference line to be for the % chart).
Thank you!
It can be achieved by:
Selection: Select all three Time Series charts;
Blend data: Right click on one of the selected charts and click on Blend data from the drop-down;
Right Y-Axis: Click on the newly created chart, and from the Style Tab, set the Axis of the Percentage Metric to Right Y-Axis (leave the other 2 Metrics as the default, Left Y-Axis), along with the Reference line.
Editable Google Data Studio Report (Sample Google Analytics Data Source) and a GIF to elaborate:

How would I make my boxplot show two columns instead of one

I'm trying to make a box plot that will show columns PSS_pre and PSS_post
At the moment I have the following code:
boxplot(PSS_post~intervention)
This code shows the column PSS_post, although I can change PSS_post to PSS_pre and it will show me the column for PSS_pre. How can I make it show me both colums at the same time?
Consider plotting a list with the 2 elements.
pp_list <- list(Pre = PSS_pre~intervention, post=PSS_post~intervention)
boxplot(pp_list)

Graphite: multiple series with a single command

I would like to put two series in the same graph on the graphite dashboard. However, since the dashboard requires single-line commands I could not find a way that doesn't involve the use of a wildcard.
Here's an example of the two series I would like in the same graph:
sum(base.foo.bar.positive.*)
sum(base.foo.bar.negative.*)
I tried several separators but I could not get it to work. Any ideas?
You have a few options here...
Merge the 2 graphs on to the graph via the drag and drop in the dashboard
OR
Use the sumSeriesWithWildcards() function
Merge 2 or more wildcard matching
Open your first graph on the dashboard
Open your second graph on the same dashboard
Click and hold the second graph and drag it over the first graph
Use groupByNode() and wildcard matching
This is not as nice, and will not always work however you will be able to do this all in one line.
sumSeriesWithWildcards(base.foo.bar.{positive,negative}.*, 3)
This will do the following:
Select all all the graphs that match base.foo.bar.positive.* and base.foo.bar.negative.*
Sum the data by the node at position 3: positive, negative
You might want to have a read over the following page: http://graphite.readthedocs.org/en/1.0/functions.html

Creating a chart in ASP.net

I am working on a project and need to add an additional image using the asp:chart control. Unfortunately, I've never had to use this control before and it's a bit complex to use, so I need some help.
Basically, I need to create a stacked Column chart with two legends and two columns. The first column is "income" and stacks three values. (Wages, interest and other.) The second column is "expenses" and stacks two values. (Mortgage, Other.) Each value has it's own value.
The legend for income should be on the left, the column for expenses to the right. These legends should display the texts and values for it's related value plus a 'Total' label with value.
For this task, I only have to deal with 5 values over two columns but the asp:chart control is huge and I'm drowning in all it's options. And they want it ready yesterday, so no pressure. It's already overdue... :-)
No, it's not homework. If it was, I would have practical documentation and the additional how-to information. Since my Boss expects me to add this, he just gave me absolutely no information to work with, except for the code which already contains several other charts, none of them like this one and all done by previous victims who each used their own coding style. Basically, the project code is a huge mess so useless as documentation. (And amazingly it works, as long as I only use asp:chart for these graphics.)
The biggest problem I'm having is stacking the values correctly. Since I have two columns and 3 values, it could be solved with three series, each with points for column 1 and 2. Unfortunately, this puts income and expense in the same label, which is not what I want.
If I make it 5 series, for every value one point, then the second column doesn't start at the right height. So that won't work either.
You can download Samples for Chart Control from msdn which give you complete in depth knowledge of how to use them
http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=1591
For learning see these blogs as well
https://web.archive.org/web/20211020203246/https://www.4guysfromrolla.com/articles/072209-1.aspx
http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx

Resources