Filtering the View Without Filtering Underlying Data - TABLEAU - tableau-api

In the above image, I have added a lookup calculation to limit the number of values on the x-axis.
Formula for Lookup : lookup(min(([Weeks out ])),0)
{Weeks out} is the x axis
Currently the range selected is -36 to 0.
There are values present for >0 but because of the lookup, it doesn't show up.
I want to show the total running sum on the 0th axis(this should include all the values available after 0)
adding tabular format for better understanding

Related

Percentage of total changes on applying filter

I have a data table with three dimensions and one measure. For each row, I am trying to calculate the percentage of total (calculated by taking the sum of rows) using a calculated field.
As seen in the screenshot attached, For the column titles 'Dec-19' I want the values to be a percentage of current value / grand total (calculated at the bottom as 122,187)
Screenshot of DataTable:
So e.g. for the Column B value of 2000, the Dec-19 column should be (97/122,187) * 100 = 0.079.
I have achieved this by creating a calculated field with the formula: SUM (sales) / MAX ({EXCLUDE (Column B): Sum (sales}), where sales is the measure used in the datatable.
However, upon application of filter on column B, the percentage value changes. e.g. if I select the value 2000 in my filter for column B, I get the percentage as 100%. It seems as if the percentage is being calculated based on only the rows in the filter.
Since you haven't included any sample data, I created some sample data like this, hope this resemble yours.
Thereafter, I built a cross-tab view in tableau, somewhat like yours
If that is the scenario, use a calculated field, say CF like this, instead of yours
([Sales])/
{FIXED [Col1], DATETRUNC('month', [Col3]) : sum([Sales])}
Dragging it in the view
and thus, filtering won't affect your calculation

compute difference between 2 ranked columns in tableau

I am trying to find the difference between 2 columns in tableau. The catch though here is that each column is ranked based on a value. The difference i need is between these 2 ranked columns
The rank is computed using the table calculations rank function. Attaching the picture for more information
I am assuming "current" and "prior" are calculated fields.
Just create a new calculated field, here I'll call it "Result". In this field just minus your one from the other so:
[Current - Prior]
Then pull this new field into your measures values on your sheet.

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.

Tableau: Plot percentage of binary column

Simplified example: column of 'measure' data is binary 0's and 1's. The sum of the column (all the 1's summed) is 3948. The length of the column is 4567. 3948 is 86% of 4567. How do I create a bar chart showing this percentage. All I can get is a bar adding up to 100%.
I've tried absolutely everything in the percentage of dropdown, calculated fields, online tutorials, etc.
Two approaches:
Right click on your measure field on whichever shelf you placed it. Choose Quick Table Calc -> Percentage of Total. Experiment with different settings for "Compute Using" and read about addressing and partitioning of table calculations to learn how to specify percent of "what".
Or create a calculated field specific to your problem defined as below:
sum(int([my measure field] = 1)) / count(1)
Be sure to set the default number format for your calculated field to a percentage, by right clicking on it in the data pane (left margin) and revising the default properties
Note, the second calculation works because the INT() function converts True to 1 and False to 0, which is useful in several contexts.
You can go about this using the following method
Add 'measure' to Columns and make it a Discrete Dimension
Add SUM(Number of Records) to Rows. This should give you the bar chart you need.
This would help achieve what you are looking to do. For more customization and a better look for the graph you are looking to build in Tableau.
Add 'measure' to the colour legend and make it a Discrete Dimension.
Add SUM(Number of Records) as a Label and do a '% of Total' quick table calculation.

Sum of Formula field

I have two values: Value and Percentage. To calculate the total, I just need to create a formula like this one:
({table.value} / 100.00) * {table.percentage}
My report shows the amount of sales grouping by product:
Value----------Percent-----------Total
Sum of Value---???---Sum of the formula above
The problem starts when I need to show the percent value grouped by products, I can't simply show a Sum of Percent and showing the Medium displays wrong value.
*Correct total based on the percentual.
For example, the second line of the table shows values grouped by product, as you can see, simply calculating the Medium shows 6,34 when it should be showing 8,32.
So, I was thinking about creating another formula, just to calculate the Percent value when grouped, like this:
Sum ({#Calculated}, {product.product_id}) / Sum ({table.value}, {product.product_id}) * 100
When previewing, it shows the correct values, but when running, it throws an exception telling me that I can't Sum the {#Calculated} because it needs to be bound to a grouping.
Is there any way to recalculate the percentual value based on a formula?