Apply filter just to dashboard - tableau-api

Is there a way to apply a filer just to a dashboard? That is, given worksheets A and B, and dashboards X and Y that both show worksheets, can I put a filter on X that affects how A and B are displayed on X, but isn't actually applied to A and B, and thus Y is unchanged?

Not possible. Filters (quick or action) applied to the dashboard will always be applied to the worksheet.
I believe you'll need to create separate worksheets for each dashboard.
Can you explain your use case a different way? i'm not fully understanding why you would want this functionality.

Related

How to incorporate two filters on the same field for a comparison chart

I would like to be able to add two filters on the same field in order to plot a comparison of values for two bands.
What is the way to proceed?
Ultimately I would like to generate the figure from the table below, by being able to dynamically select A/B bands from two different filters. In this case, Filter1=A and Filter2= C were selected to compute Filter1-Filter2 across the dimension 'Type'.
I have tried duplicating the filter but when choosing a band, it affects both filters.
The way to do this is with two Parameters. Each should have its values generated from the field (in your case, A/B). The create a single filter (calculated field) that says "[parameter1]=[field A/B] or [parameter2]=[field A/B]". Put the filter on the filter shelf and set it to true.
Now you have two "filters" (parameters) that can both drive the single field.

How to apply a filter to only one column? The columns differ by a value of the same binary filter

I have visualizations that have bar graphs set up in 6 separate sheets. These bar graphs need to go side by side for comparison. 2 graphs will be combined to form one side-by-side graph. They only differ by a filter that is set to either 0 or 1 in the corresponding sheets. Everything else is the same.
Example:
In sheet 1, XMJ is filtered by Misdemeanor = 0
In sheet 2, XMJ is filtered by Misdemeanor = 1
I'd like to make them show side-by-side for comparison.
I have already tried duplicating XMJ and bringing it side-by-side but couldn't apply Misdemeanor = 1 or 0 separately to the duplicate column.
Here is the file: Visualz
You can accomplish this with a table calc filter.
Create a calculation lookup(min([Misdemeanor]),0) and put it on your filter shelf in each sheet and you can filter them independently.
Table calcs happen after the data is displayed on the viz (see Order of Operations).
The min([Misdemeanor]) part tells Tableau you want to look at the minimum value (this could be also max/attr/sum it wouldn't matter in your case).
The lookup(measure,0) tells Tableau to look at the current row of the measure (but again, after the data is already on the table). At this point, you can filter it independently.
EDIT: Another thought is you might just have the filters set to All Using this Datasource or (multiple) selected sheets. You can change this behavior in either the worksheet (1st picture) or dashboard (2nd worksheet).

Relabeling Nodes of a graph in networkx

I am trying to process the graph given in wiki-Vote.txt (https://snap.stanford.edu/data/wiki-Vote.html). There are 7115 nodes with id ranging from 3 to 8297. I want to relabel the nodes from 0 to 7114. I checked the mappings in relabel_nodes() but still could not solve the problem. Please suggest. thanks
edit
I'm not sure if it's new, but my original answer didn't mention
nx.convert_node_labels_to_integers(G, first_label=0, ordering='default', label_attribute=None). So for a given graph G, you can do
H=nx.convert_node_labels_to_integers(G). This doesn't guarantee that the order is the same as in G. You can have the original label be stored in H if you call H=nx.convert_node_labels_to_integers(G, label_attribute='original_name'). You can guarantee that the order is the same as in G, by setting ordering=sorted(G.nodes()).
original answer
Given a graph G with some set of nodes, the simplest thing would be
mapping = {old_label:new_label for new_label, old_label in enumerate(G.nodes())}
H = nx.relabel_nodes(G, mapping)
This will create a dictionary mapping whose keys are the old labels and whose values are their new labels (read up on dictionary comprehensions). The ordering of the new labels is given by the order that G.nodes() returns the values (which you can't control). The new graph H has the node labels changed.
If you want a specific order, you need to sort G.nodes() appropriately. So you can do
nodelist = G.nodes()
nodelist.sort()
mapping = {old_label:new_label for new_label, old_label in enumerate(nodelist)}
H = nx.relabel_nodes(G, mapping)
which would have them sorted in numerical order (or alphabetical order if the node names are strings). If you want some other custom order, you'll have to figure out how to sort nodelist.

Tableau Calculated Field Filtering

I am struggling with Custom Filter using Calculated Field.
Below is the screenshot of the same visualized chart.
What I am struggling is to create a filter where I can give a scale of Correlation, example - I want to show all the age groups and Ethnicity where the Correlation value is between 0.6 and 0.9
I am able to bring in one Measure Value and as you can see, the filter slider is there. But I need that filter to work on all the fields and not just one value. Like a Universal Slider for all the values.
Please help.
You cannot set one filter to be used on several measures. However what you can do is create two parameters and use them to filter each measure in relation.
create 2 parameters minCorrelation and maxCorrelation with values between 0 and 1 and stepsize of 0.1 (or whatever granularity you need)
open one of your filters and go to formula, use a custom formula like [0-17] > [minCorrelation] AND [0-17] < [maxCorrelation]
repeat that for every measure and the filter will adjust when you change the values for your parameters.

Excel - Circular References (all values change when one changes)

I have several products. Each product has four different dimensions, and they're each dependent on one another. Meaning, if I know one, I know the rest of them.
Each product is different, so the way that they depend on each other is different. But the fact of the matter doesn't change-if i know one value of any dimension - i know the rest.
I'd like to be able to just type in a value into the cell and have excel automatically populate the rest for me.
It's too tedious with VBA and i'd like it to be automatic upon entry, and not have to have someone click a button. Just when you type it in.
Thank you
What you want is impossible without VBA. I offer you a simple method instead:
There's an infinite amount of ways to do that. I want some SE points. So, I will just post the first method that comes to mind.
Have two rows:
Input: [Height] [Width] [Length]
Result: [Height] [Width] [Length]
(the above will have the following shape:)
A1 B1 C1 D1
A2 B2 C2 D2
You don't touch the result row. You input into the blank input rows and then the result rows check for the input and calculate accordingly.
In the result row, you will use "nested if", NOT(ISBLANK(A1)) and your own calculation method. Here's an example of nested if: =IF(NOT(ISBLANK(A1)),A1*2,IF(NOT(ISBLANK(B1)),B1*3,IF(NOT(ISBLANK(C1)),C1*4, IF(NOT(ISBLANK(D1)),D1*5))))
Each cell in the result row will require a different calculation formula.
I suggest you open a brand new excel worksheet and paste the above formula into cell A2. Then, type a number into either A1, B1, C1 or D1 and notice what happens in cell A2.
Also, please note the above formula has not been "fixed". If you drag the formula, excel will try to adjust it and things can go bad.