My goal is to create a line graph that allows users to select different timeseries that they want to show on the graph. Users can select more than 1 timeseries if they wanted to.
I have created a multi value parameter (e.g. test_feature) and linked it to a control parameter.
How do I create a calculated field that I can add to the line graph that would show whichever selections (can be more than 1) that users select in the dropdown list? For now, I have created 1 calculated field per line with the code below:
Welcome to the community and thanks for asking your question.
To help answer your question, can you describe how you would like the selections to appear on the line graph? For example, here Iâve used the legend to display the active selections:
I would like the selections to appear based on what the user selects in the dropdown. so for example, if the user selects âAMERâ and âAPJâ then it would appear as what you have plotted. If the user selects âSelect allâ then all lines will be plotted as well. If none is selected then nothing appears on the graph.
As far as I understand, I would need to add a calculated field that contains all the lines - AMER, APJ and EMEA to the line graph Value section. The calculated field is then linked to a parameter and a control (âcRegionâ) that is created as you have shown.
My question is how do you create 1 calculated field with the âcontainsâ statement and âifelseâ to take into account all the possible lines that a user can select.
Hi @abacon, the way that I implemented it right now (with 1 calculated field per feature with the code I mentioned) also means that the legend always shows all the timeseries even if they are not shown on the graph which is not ideal
hi @abacon, thanks for your suggested solution. This does not exactly work for me because I do not have the lines that I am trying to plot as a field in my dataset (what you set in your parameter control).
For me, the lines that I am trying to plot are individual timeseries columns in my dataset instead of different values within the same timeseries.
Hi @avid_learner,
Itâs been awhile since last communication took place on this thread, were you able to find a work around for your case or are you still working on this?
In regards to your last note; so do you mean that you are trying to show multiple field (column) values on the same visual?
Could you share an example of what your âindividual timeseriesâ look like? Additionally, how many inidividual timeseries options do you have that youâd like to be options in your multi-select?
If we do not hear back within the next 3 business days, Iâll close out this topic.
Hi @Brett, no I have only implemented the original solution that I first posted about but I am quite dissatisfied with that because it is a very tedious solution.
Just to reiterate my problem, I have for example 10 different columns in my table (col A - col J). Every single column is a timeseries that contains data with a float datatype. I am trying to create a line graph where users can select which column out of the 10 they want to show on the graph. It can be 1 or more lines and is entirely up to the users selection. When nothing is selected, the graph should show no lines.
For now, I have done the steps below:
Create a multi value parameter, e.g. test_feature
For each column that I wan to show on the graph, I created a calculated field with the code below, for example:
I then put each calculated field in the line graph âLine Selectionâ and also created a control parameter where users can select which column they want to show on the graph.
The part which I am trying to get a better solution for is having to create 1 new calculated field for each column that I am trying to include in my line graph. Also, I am trying to get the legend to show only columns that users selected and not all 10 calculated fields constantly.
Hi @avid_learner and apologies for missing your last response! I tested out a few different scenarios and what the conclusion I came to is that because youâre utilizing a multi-select parameter along with multiple fields/columns, I donât believe thereâs an alternate work around to get this working in the way that youâd like. I believe you would need to utilize a field like Andrew suggested.
I can mark this as a feature request for additional flexibility when working with a multi-select parameter.
If you were able to find a different work around that could potentially work for this scenario, feel free to share your findings here!
Hi @avid_learner,
Following up here to check in and see if you were still working on this case or if you were able to find a work around in the interim?
Let us know if you have any additional questions, if we do not hear back within the next 3 business days, Iâll close out this topic.
Hi @avid_learner,
Since we have not heard back, Iâll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.