Tableau: Set a filter with one value always selected and let user to choose others? - filter

I want to create a table with a filter for use to select and compare things:
Say I have a variable Var, containing values A, B, C, D, E. I want to have a filter so that an user can select one of A B C D, meanwhile E is always selected. So the selected one and the fixed E can be display in one single table.
What is the best approach to achieve this (I checked other posts and they seem not working)?

One easy solution if the choices for your variable are relatively stable is as follows:
Create a parameter called say, Chosen_Var, containing the values that you want the user to choose between (i.e. A, B, C, D). Parameters can hold a single value.
Create a calculated field called say, Var_Desired, to distinguish whether an individual data row meets your filter criteria [Var] = "E" or [Var] = [Chosen_Var]
Place that field, [Var_Desired], on the filter shelf and select only the True value
Show your parameter control and configure as desired
This will allow users to select one of the values A, B, C or D, and then filter to only include data where [Var] = the fixed value E or the value the user selected.
If the set of legal values changes frequently, so that using a static list of parameter values is difficult, or if you want the user to be able to select multiple values, you'll need another solution.

Related

How to skip columns in “List from a range” Criteria?

Is it possible to create a "List from a range" Data Validation rule in Google Sheets where the range skips columns?
For example:
Cells A6:A11 is limited to the range A1:B3. Cells B6:B11 is limited to the range A1:A3 AND C1:C3 (skips column B).
Creating a Data Validation rule for cells A6:A11 is trivial as I simply need to create a Criteria of "List from a range = A1:B3".
However, creating the Data Validation rule for cells B6:B11 is not so intuitive since Google Sheets does not allow me to create a Criteria using the syntax "List from a range = A1:A3, C1:C3".
Does the "List from a range" Criteria support a syntax that allows us to skip columns within a range?
Note: I currently have a work around for this where I defined an array formula in D1 = =ArrayFormula(if({1,""},A1:A3,C1:C3)) and then use D1:E3 as the Data Validation range. But this is a hacky solution and I'm hoping there is a better way to accomplish my goal.
The solution is to use { } to create a combination of columns or rows that will result in some sort of virtual table on-the-fly.
Example:
Assuming you have a spreadsheet with Name, Age, Gender, Phone and Address in A, B, C, D and E, and you want to skip the Gender (column C) while using the UNIQUE statement, you can use something like this.
Put in G1 the following formula:
=UNIQUE({A1:B, D1:E})
From the cell G1, the spreadsheet will populate the columns G, H, I and J with unique combinations of A, B, D and E, excluding the column C (Gender).
The same application of a combined range can be used in any formula and also you can combine multiple different ranges, including cross Spreadsheets and Files.
It is a very useful trick if you need to combine pieces of multiple spreadsheets for data visualization or reports. However, always remember you cannot manipulate the displayed data. You can still search through it, format it, etc., but you cannot change it. On the other hand, it will auto-update always if the data source gets updated, which is very useful.
Note: Try it with LOOKUP, VLOOPUP or HLOOKUP.

Populate C with max value of B for each row of related values in A

Goal: Using Excel 2010, how can I get each change number's (listed in column A) to show the Max Business Criticality (from column B) to display in column C via formula(s)?
Let me explain: I have a list of Change tickets (in column A) where the change number will likely be listed multiple times (due to different locations and servers). This means each change number may be listed once or may be listed 20 times. Each occurrence of the change number is assigned a Business Criticality (again, based on different locations and servers). This value is captured in column B.
In column C, of the same table, I need to return the max criticality associated with each change and have that be displayed in each row (see image for desired result - colored for ease of differentiating change numbers).
Everything I've seen involves creating a distinct list of change numbers separate from the source table. I'd rather not do that.
How can I get each change number's MaxCrit to display in column C?
I'll try to attach the file if I can figure out how (and/or if I have rights to do so).
In C2 with Ctrl+Shift+Enter and copied down to suit:
=MAX(IF(A:A=A2,B:B))
with

How might I filter out one half of a relationship set between values of two columns?

I'm trying to isolate one half of the relationship set between two columns in a table. For instance, if I have a table like this:
It show a relationship set between A and B (or B and A) twice. Once for each direction of the relationship...first A to B and then B to A.
So how might I be able to identify and filter out the second half (direction) of the relationship set?
To achieve a result like this?
Is there a "simple" way?
There may be a more efficient way, but this should work:
Add a column which creates a sorted text value of the two columns, possibly separated by a character that won't appear in either column. You can do this by calling List.Sort on a list of the cell values, and then using List.Accumulate to join the strings. For example, the expression to use in Add Custom Column could be each List.Accumulate(List.Sort({[Column1], [Column2]}), "", (state, current) => state & ";" & current).
Use Remove Duplicates on the new column to get rid of the duplicate relationships (i.e. use Table.Distinct).
Remove the added column.

Conditional Mapping in Talend

I have created a simple job in Talend that will perform an inner join in the data between 2 excel sheets and then dump the result in an output excel sheet. This can be best illustrated by the below diagram :-
The mapping used in tMap is :-
However the additional challenge for me now is that I have to perform this mapping only if the column value in that row is not NULL. eg there is a mapping row1.RECID = row2.RECID, but this should only be legal if row2.RECID is not NULL.
How do I achieve this in Talend? I have experimented a lot with tMap expressions but can't get it right..
Here is a small sample input and it's corresponding expected output.
Suppose my input has values :-
v1, v2,v3,v4
1 , A, O, 3
2, B, X, 4
3, C, X, 4
and lookup has values
v1, v2, v3
1, A, O, 3
2, null, X, 4
3, null, C, 4
2,null,X,null
Then the output should be :-
v1,v2,v3
1,A,O,3
2,B,X,4
2,B,X,4
Before joining your input flows, you have to reject rows with null values, I have created a mapping based on the given simple data.
Try to map the maximum of values from row1, the put row2 with left outer join.
I you want values which are only in row1 and row2, you can add a filter in row2 for that (but I guess that this is not what you want)
Talend does have a more elegant option that will allow the filtering of your data on multiple columns. Use the tSchemaComplianceCheck component where filtering out nulls and empty is as simple as clicking a couple of check boxes. This allows you to use your own schema to check against nulls and empty values and filter them out. The error rows go to a reject flow which you have the option of processing. If you do not wish to capture and process the rejects you can simply ignore them. Your main flow will only have the records that passed the compliance check. Here are some tips on using it:
In the tSchemaComplianceCheck component -->Basic Settings Screen click Custom Defined and it will show you each column. Make sure Nullable is unchecked or else it will allow nulls to pass thru.
In the Advanced Settings tab check Treat all empty string as NUll. This will work in conjunction with the prior step to filter out both null and empty.
In your Excel component, click Advances Settings tab, and check Stop reading on encountering empty rows.
below is a screen shot which shows the basic flow and setting. You would link to a tMap instead of the tLogRow. If I have understood your problem correctly I think you will find this is the ideal solution in Talend.

Using the same OrderByAttribute for two attributes in one dimension

In my SSAS cube I have a dimension with attributes A and B, and I want both to be displayed in the sort order specified by a third attribute C. If I specify C as the OrderByAttribute for A and reprocess the cube, then A is sorted correctly.
If I then specify C as the OrderByAttribute for B as well and reprocess the cube, then A continues to be sorted correctly but B does not. Values of B are displayed in an order that seems arbitrary. I have triple-checked that there is no difference in the way A and B are configured.
Is there some conceptual reason why two attributes in a single dimension cannot be both sorted by the same third attribute?
I have now located the problem but still looking for a solution.
As mentioned in the comments, the dsv has tables CM and DisplayOrder between which there are two relationships -- from CM.A to DisplayOrder.primarykey and from CM.B to DisplayOrder.primarykey. SSAS constructs the attribute A using the query:
select distinct CM.A, DisplayOrder.SortOrder
from
(<named query for CM>) as CM,
(<named query for DisplayOrder>) as DisplayOrder
where CM.A = DisplayOrder.primarykey
That is correct and works fine. But when SSAS constructs the attribute B, it uses the query:
select distinct CM.B, DisplayOrder.SortOrder
from
(<named query for CM>) as CM,
(<named query for DisplayOrder>) as DisplayOrder
where CM.A = DisplayOrder.primarykey
Note that the where clause links the two tables using A rather than for B.
So in summary, when the dsv has two tables with two relationships between them, the join in the queries generated by SSAS to implement the OrderByAttribute always use one of those relationships and ignores the other.
Any idea why, or if there is a property somewhere I may have missed?

Resources