In Grafana, how to build a data link to filter current dashboard when there is more than one variable? - grafana

I'm using Grafana v8.3.4 (a551d74b11)
I've a dashboard with many variables (filters). One of those is for exemple TransactionType.
I would like my charts to filter on click.
For example with a pie chart using TransactionType, I want to filter the TransactionType variable ,when I click in one of the element of the pie chart, by this element.
The closest feature I found is to use data link.
So far I tried in the pie chart the two data link there after.
The syntax is OK but the effect is not doing what i’m expecting.
a)
/d/${__dashboard.uid}/${__dashboard}?var-TransactionType=${__series.name}
For this one the data link apply the filter on TransactionType but clear all the other filters variables, even clear the All, so the dashboard is in error.
b)
/d/${__dashboard.uid}/${__dashboard}?${__all_variables}&var-TransactionType=${__series.name}
this one apply all filters first then add the TransactionType filter but, it keep the previous All value, so the filter become All + value, that don’t work, the dashboard is in error too.
==> Is there a way to keep all the existing variable filter unchanged and replace the value for one variable filter ?

move var-TransactionType=${__series.name} before ${__all_variables}

Related

Tableau | Display different sheets by selecting option(s) from one particular filter

Is there a way to display different sheets by clicking/selecting values/options from one particular filter?
for example, if I have this filter:
and I need to display a sheet named Departments when I select Commercial from the filter shown in the PtrScn.
However, When I click/select any other options like HR, Information ...etc, I want it to display the associated sheet with the filter "Filter by Sector"
Any hints would be highly appreciated!
NOTE: I use tableau 2019.1 and it does not show "Change Parameter" that might be needed to approach this as I noticed when I have been researching for two days now!
You should use a container (say vertical) where you wanna put your N worksheets one on top of the other one without changing vertical spacing: just let Tableau do its stuff!
Be sure to remove the worksheet titles.
Once you're done, you need to create a parameter in order to handle all the N possible choices, and according to that you need to create N Calculated fields with a condition like this one:
if [Param] = 'Profit' then 'ok' else 'ko' end
Each calculated field will be used as a condition (select just ok values) in your filter selection.
Since the parameter can accept just one value a time, you will have just one of your N worksheet displaying data.
And this is the trick based on the vertical conatiner: if you hide worksheet titles, you will see "something" just for the selected worksheet and Tableau automatically will handle all the vertical space in the container.
The result will look like the following:
Adding to Fabio's great answer, these resources about collapsing containers may be useful:
Sheet swapping using collapsing containers
Automatically resize items in a Tableau container (or make disappear in your case)

Azure DevOps Server Pie chart slice not filtering

I have a Pie chart as follows:
It has slices representing count of Work Items by State. When I click a slice, I'm taken tot he query result showing all work items instead of filtered to clicked state:
Here is the query:
What do I have to change here to get a filtered result instead of all?
You can use the "Filter work item" option in the top right corner to filter the status of work items.
As of this time, however, clicking on a slice and then displaying work items of that status is not supported. When you click on the chart, you essentially open the query used by the chart.
So you need to manually filter your desired status after clicking. In addition to status, it also supports filtering of information such as Assigned to, Tags, and so on.

Grafana define Title value for chart

I am trying to create a dashboard. Able to generate Bar Gauge from the Prometheus data for simple query sum by (namespace) (kube_pod_container_status_running)
I want to display only Namespace rather than {namespace="kube-system"}, so was playing with Visualization > Field > Title for a while, but was not able to figure out.
Any Idea How can just display kube-system instead of {namespace="kube-system"} and make the list in sorted order, because everytime when i refresh the dashboard, it reshuffles the order.
What I need here ?
https://grafana.com/docs/grafana/latest/features/datasources/prometheus/
Legend format
Controls the name of the time series, using name or pattern. For example {{hostname}} will be replaced with label value for the label hostname.
=> configure Legend format in the Queries section and add {{namespace}} there.
I'm not sure about sort. You may try Prometheus sort/sort_desc function to sort query result.

Tableau Filter from calculated field, but I want to exclude some

I am trying to add to my current calculated field.
It is a fairly simple LEFT(UPPER([STR]),2) that I am currently using. This populates a filter list. However, I want to either modify the formula or the list itself to only include [STR] items where underlying data is and for any that do not have data, they are left off the list until they have data to be selecting.
think of the STR as if it were states abbreviations. IF COUNT([Things]) = 0 then I don't want the state on my filter list, but if there is or if there later gets some Things added in that state I want it to show up.
I tried using IF COUNT([Things]) > 0 THEN LEFT(UPPER([STR]),2) END but that doesn't seem to work. I am also open to just using a condition for showing the filter if that can work, but I am not sure how to set that up.
Strangely I had tried this solution before. I choose Show only relevant values on the filter in the filters box, that made it show nothing at all. However, if you click the drop down arrow on the Show filter card and choose show only relevant values that works.

Tableau add formula to dashboard action filter?

I've got a workbook I'm building using public data https://public.tableau.com/profile/alee4645#!/vizhome/JSAClaimantsWardtimeseries/Dashboard1
The basics are working as I want, you see the map, you click on one of the coloured areas and a time series chart appears below the map showing the change over time for that area.
I want to add a couple of comparisons to this data, for example I want the time series chart to show a line for the whole coloured area (Somerset) so people can see how one part of it compares to the overall average.
I have the figures as separate rows in the data but of course when the action filter is triggered they get filtered out along with everything else.
If I edit the action filter in the filter shelf for sheet 2, it has the condition tab and I was hoping I could add [ward code] = "E10000027" (the comparison data I want to use) to the formula box so it would also keep the relevant rows of data, but that stops the chart working altogether.
I could achieve it by getting people to choose an area from a parameter drop down but I'd rather let them click on the map so they don't need to know the name of the area they are interested in.
Can this be done?