Linking two data tables by multiple columns in Spotfire - spotfire

I have two tables that I've loaded into spotfire. In these tables, 3 of the column names match but don't necessarily contain the same content.
For example:
Data Table 1 contains data in every column.
Name Feature-1 Feature-2 Feature-3
A AB AC BC
Data Table 2 contains the same column names, but 2/3 matching columns will be empty!
Name Feature-1 Feature-2 Feature-3
A1 AB NaN NaN
A2 NaN AC NaN
A3 NaN NaN BC
I can successfully link the two data tables with a single column, but it seems like when I add relations for 3 columns ALL of those columns must match (column1 & column2 & column3).
Is there a way to specify I want to have any of those columns match (column1 or column2 or column3)?

if the columns in table2 are such that only one of them is ever populated, you can calculate a column [Features-merged] as Concatenate(Feature-1,Feature-2,Feature-3) and use that for your relationship match

Related

Split values in column in a excel sheet by delimiter, but split identical values to the same new column

So I have an excel sheet with a column that contains multiple values separated by the pipe character. I need to split those values to their own column, which works with the "Text to Columns" function.
But is there a way to move identical values from different rows to the same column? Empty cells might be required, because not all rows contain the the same number of values in the original column.
Its propably best to show it with this example:
I have this:
row
column_1
1
value_1|value_2|value_3|value_4
2
value_2|value_3|value_4
3
value_1|value_2|value_4
4
value_1
5
6
value_3|value_4
7
value_1|value_3|value_4
I need this:
row
column_1
column_2
column_3
column_4
1
value_1
value_2
value_3
value_4
2
value_2
value_3
value_4
3
value_1
value_2
value_4
4
value_1
5
6
value_3
value_4
7
value_1
value_3
value_4
The values contain the same string regardless of the row. So value_1 in row 1 is exactly the same as value_1 in row 3.
I found a workaround solution that can help produce the following output (the text in blue is a dummy variable)
In this case I have used a CONTAINS logic in the columns C-F, asking myself if the text in blue is found within column B, for each specific column.
For example for cell C3: does cell B3 contain the text "value_1"? If yes, add the text to the cell, if not, leave the cell empty.
The formula I've used is shown belowm(can be dragged to all cells)
This workaround needs you to manually add the text you would be looking for in each column --> this is what I added in blue. I know this is a manual step but it only needs to be added once!

Sorting rows by matching values in two different columns

I have to look through my worksheet to find duplicate entries on the basis of two columns - column A and column D. If entries under both these columns match in any two given rows, then I consider them duplicated. In order to do this, I have been trying to sort the rows such that rows with matching entries under column A and column D appear one below the other. For example, if I have:
Col A Col B Col C Col D
ABC PQR 123 456
ABC XYZ 789 006
ABC BNM 376 456
ABC QWR 387 006
Preferably through VBA, I want to be able to put it in the format:
Col A Col B Col C Col D
ABC PQR 123 456
ABC BNM 376 456
ABC XYZ 789 006
ABC QWR 387 006
I am aware of how to sort by one column but not sure if there is a way to do it by two. There are more than 5000 rows in the worksheet and more than 50 columns and I would like to be able to sort these quickly for comparison.
Excel has built-in functions to help you with the issue (no VBA required).
Select the cells including your data and navigate to "Data - Sort & Filter - Sort". There you can add different levels of sorting (e.g. sort by Col A first, then by Col B, ...).
If the duplicates need to be removed this can be done directly as well. Select the cells including your data and navigate to "Data - Data Tools - Remove Duplicates". You can select the columns which need to match in order for Excel to remove the duplicates.

Vlookup string/wildcard within string

How do I lookup a string in a string and populate corresponding column from different sheet?
For example, if Sheet 2 Column A has Ford Ikon and Column B has Car and Sheet 1 Column A has Ford Fortuner, I want to populate Car in Sheet 1 Column B by matching Ford.
I want to run this at scale for multiple attributes and rows and hence, looking for a macro
Keyword Data
Input Data

Finding and obtaining the difference between two columns

I have two columns. Each column has tens of thousands of values. I need to find the difference between them and print the difference in some cells. I read similar questions, but they are not enough for my question, highlighting the different cells is not enogh for me because it would be very tiring to look at tens of thousands of cell by searching highlighted cells. Thus, i need to obtain the values.
Example:
Column1 Column2
John Jennifer
Mary Washington
Joe John
Michael Texas
Houston Newyork
Texas Mary
Values existing in col1 but not col2 : Joe, Michael, Houston
Values existing in col1 but not col2 : Jennifer, Washington, New York
Algorithmically, i need to check each row of column1 whether it exists in Column2, if the row does not exist in Column2, the value is taken.
Similarly, i need to check each row of column2 whether it exists in Column1, if the row does not exist in Column1, the value is taken.
Thanks
Old: If this is a once-off i'd make a backup then mark the area of the two columns and "remove duplicates" which is a button on the DATA command bar.
You would be left with unique records only, which is what I understand you want.
Edit: If you want to completely remove duplicate values then: Assuming that col1 is "A" and col2 is "B" then this formula only shows the record if it is in A but not in B. You can make a similar one for B not in A. In my example I made two columns C, D for the unique values. Then filter the list on these being "not nothing", and you have a set of unique records.
Current formula is for A2 cell - in my example placed in C2.
=IF(ISERROR(MATCH(A2;B:B;0));A2;"")

Two Tables Excel values

I have two tables in two different sheets. In Table 1 and table 2 column 1 is for id's. but in Table 2 I have more id's than table 1.
What I want is: if a cell in table 2 column 2 is filled to check the id and if its in table 2 to mark "yes" in column 2 in Table 1.
This is the code I have been using but it stops when the ids don't match:
=IF(AND(Table 2[column 2]>0,VLOOKUP([column 1],Table 2[column 1],1,FALSE)=sheet 2!A5),"yes","")
You could put something like this in table 1 column 2. Assuming table 1 is in columns A,B and Table 2 is in columns D,E. That is column D is the id in table 2 and column E is the value in table 2.
This will return an error if there is an id in table 1 that isn't in table 2. To deal with this you could wrap it with iferror.
=IF(INDEX($E:$E,MATCH(A1,$D:$D,0))>0,"yes","")
Gordon
You might try:
=IFERROR(IF(VLOOKUP(Table1[[#This Row],[column 1]],Table2[#All],2,0)<>"","yes",""),"")
at the top of column 2 of Table1, adding spaces in the table names if you have been able to.

Resources