Filtering Based on a Different Column on Tableau - tableau-api

I'm wondering if something like this is possible.
Assume I have a data table like this:
I want a filter, where user picks France for example, but the data is filtered based on corresponding Continent value, e.g., all Europe records should show up.
Is this possible?

Sure, We can do that. If you add country to Filters shelf, Tableau will show only records of selected value. In our case, if we filter "France", Tableau shows only records which has France. So we will miss other Europe records. Parameter can handle this scenario. Follow below steps.
1.Create a String parameter
2. Create a calculated field
3. Add the created calculated field to Filters shelf then choose 'show'
4. Right click parameter then 'Show parameter control'. So it will works like filter
Method 2: Dynamically change parameter value
Pros: No hard coding, dynamically changes value based on selection. It works, well on dashboard
Cons: You will not have drop down for selection like filter. So, you need to click a chart to trigger the changes.
1. Create a String parameter with allowable values as 'ALL'
2.Create a calculated field
3.Create a parameter action in dashboard.
Dashboard-> Actions-> Add Action -> Change Parameter
In Change Parameter dialogue box, set target parameter as 'Parameter Name' and value field as 'Continent'
4. Add the calculated field to filter and select 'True' on other sheets
5. Final Dashboard looks like
Click the icon on the selector sheet. It will automatically filter data on data sheet.
Inside the selector sheet

Related

Tableau set default value in the filter

I have a gender of a person and i want to create such filter
How can i set deafault "men" value in this filter?
When user select another value and then deselect value i need to
return default value in the filter
I've already tried to create such a calculated field, but it does not work with
MIN({FIXED: COUNTD([gender])}) <> MIN({EXCLUDE [gender]: COUNTD([gender])}) OR MIN([gender])="men"
There are several tutorials about creating a default value for filtering (and several different techniques), one of them is this one: Dynamic Parameters, Default Values and the Flexibility to Choose
For me, if you just have to put "men" as default (I mean, not a calculated value, like today's DateTime), you can just filter man before publishing your dashboard to Tableau Server/Tableau Online and every use that navigates your content will find this value selected.

Query on Tableau Dashboard

I am a new to Tableau and having some issues with it.I am Using a parameter to filter month data across Sheets connected to different Data Sources.
I want to Filter Current Month Data Automatically when the dashboard starts.
Can anyone guide me on how to do it.
Thanks in Advance.
T
Introduced in version 10.3 is a feature called Latest date preset. The release notes say "Start with up-to-date data. Set filters to display latest date values automatically, as soon as your workbook opens." Create a filter that spans applies across the data sources and use this new setting. The setting is in the filter dialog.
See https://www.tableau.com/new-features/10.3#tab-analytics-2
The critical aspect of your question is that you are filtering multiple data sources using a parameter. Given that, the most straightforward approach is to define a boolean calculated field in each data source, called say Within_Date_Range.
Each of those calculated fields should compare the appropriate Date field in that data source to the selected parameter value and return true or false to indicate whether the current record should be included in the query. (Parameters are scoped to the workbook and visible from all data sources)
Place the [Within_Date_Range] field for data source X on the filter shelf for the worksheets that use that data source X. Check the true box of course.
Now when you change the parameter, all the worksheets filter accordingly.
Alternatively, you can abandon the use of a parameter. Define relationships between your data sources using the corresponding Date fields (under the data menu). Show a filter control for the date field for one of the worksheets and set the scope to "related data sources"
Hope this helps!
Create a calculated field Date_Filter as
lookup(min([Your_Date_Field]),0)
Drag this to 'Filter'; select 'relative date' option and choose last 1
month (because you wanted to show just the current month data by default).
Right click this filter and select "Apply to selected worksheet" and
choose sheets in which you want this filter to be applied on the
dashboard.Viola!
With this solution you can very well see current month's data by default and can go back to as many time periods you want.

Group by first two characters of column, in Tableau?

I'm using Tableau Desktop v9.0. I have data that looks like this:
code,items
02050252,7
03040620,19
03060423,3
I want to create a bar chart of the items grouped by the first two characters of the code field.
So effectively a chart that shows this underlying data:
new_code,items
02,7
03,22
Is it possible to do this within Tableau? Or do I need to group the data manually myself first?
You can definitely do this within Tableau.
Make sure that your code column is a string. If it's not, right click on it in the dimensions section and choose Change Data Type.
Then, create a calculated field (Analysis -> Create Calculated Field) and enter the expression LEFT([Code], 2), which will take the first two characters of the code field.
Drag your new_code field to the Rows shelf and Items to the Columns shelf and voila, you have your desired data. You can of course change the type of the chart, make it a table, etc. from here.

SSRS cannot linked text box with field

I group my table by 3 attributes, and set page break on every group, and now i want to display that three attribute outside the table. I want to place them on the top of the report, and when i type the expression and i go in run view it's display only the first value, when i go to the next page nothing change
I tried to drag field from table, from data set, and nothing working.
In expression i type
=Fields!My_Field.Value.
Also if some of that three attributes i placed in table it normally displays values, but when i try to move it somewhere it stops displaying.
The issue is that a table is associated with a dataset but a text box is not.
You can reference a field from a text box using the Dataset field ( =Sum(Fields!AMOUNT.Value, "Dataset1") ) but you need to use an aggregate function like First, Last, or SUM.
It sounds like you don't want to use an aggregate since you are grouping by these fields, though.
display the three attribute outside the table
If your trying to display the current grouping in the table at the top of each page, add a new Row in your matrix above your header row and add your group fields there.

Dynamic parameters in Crystal report

I have a LINETYPE parameter with the following values:
INV_DEVICE
INV_SIM
TAX
OTHER_ITEMS
If the user chooses anything from the LINETYPE parameter anything that start with "INV_*", is it possible that another parameter field be populated dynamically?
For example, the user chooses INV_DEVICE. There would appear another parameter field called GOODSTYPE.
Values for GOODSTYPE are taken from the database. Example:
PAGER
GSMPHONE
SMARTPHONE
TABLET
But when the user chooses TAX or OTHER_ITEMS the user does not need to choose any value from GOODSTYPE, or the parameter field does not show at all.
The output of the report are those matching the criteria the user entered.
Note that for LINETYPE and GOODSTYPE, user can choose multiple values.
LINETYPE is a mandatory field, but GOODSTYPE will vary upon the values chosen by the user in LINETYPE
What you really want is call Cascading Parameters. The first selection leads to a refined list on the second selection which leads to another refined list, etc. Like Country -> State/Province -> City.
I don't use it but from what I gather, your selection needs to be stored in a table. To create a Cascading Parameter:
Create a new parameter
Under List of Values, select Dynamic
Select your value, description and Paramter
Set the option for Allow Multiple Values
repeat step 3-4 if you have more parameters.