Need help on searching a table for a certain string

I have two tables.  One I need to search in to find a certain string and/or column.

I have tried using - Contains(), IN() and LOOKUP(), but have failed.  In the screen shot you can see I have a dash set up with views/tables.  Table A has column [equipment].  Table B has column [item List].  I want Table A to search table B to make sure that [equipment] is IN column [Item List].  I also want Table B to search Table A to do the same thing.  I seem to have Table A working correctly, it formats the row to "Green".  Table B, I cannot get correct.

Tiger1_0-1731610690449.png

 

 

0 27 480
27 REPLIES 27

Steve
Platinum 5
Platinum 5

@Tiger1 wrote:

I also want Table B to search Table A to do the same thing.


I don't understand.

Well I want/need Table A to search as well as Table B.  Why?  So when I use formats (green for match and red for no match) I can color EACH view (Like the green row above).  Table B - has nothing in green - yet that first row SHOULD be green.  Does that make sense?

So...

A row in Table A should be green if its [equipment] is CONTAIN()ed in [item list] of any row of Table B.

And...

A row in Table B should be green if its [item list] CONTAIN()s an [equipment] from any row of Table A.

Correct?

YES, EXACTLY!

For Table A:

ISNOTBLANK(
  FILTER(
    "Table B",
    CONTAINS([item list], [_THISROW].[equipment])
  )
)

For Table B:

ISNOTBLANK(
  FILTER(
    "Table A",
    CONTAINS([_THISROW].[item list], [equipment])
  )
)

It seems to work, however every row in Table B is green, which I OLNY want the row that contains it to be green:

Tiger1_0-1731612573957.png

 

Please confirm the expression you're using. I had to correct what I posted first. What's there now is correct.

Table A:

Tiger1_0-1731612850729.png

Table B:

Tiger1_1-1731612882163.png

Is it right?

 

It looks right to me

Are you sure the literal text 4751 doesn't occur anywhere in [item list] of the second row of Table B?

I checked it, but there are like 7 rows and ALL are green.  I am pretty sure NONE conatin that.  It has to be exactly "4751" in that order, right?  

If I expand that Table/view and search for "4751" - only ONE row shows:

Tiger1_0-1731613358361.png

Now when searching:

Tiger1_1-1731613391827.png

 

 

 

Please post screenshots configurations of the equipment column of Table A and the item list column of Table B.

Table A, showing [equipment]:

Tiger1_0-1731613852793.png

Table B:

Tiger1_1-1731613894269.png

 

Is the dashboard an interactive dashboard? If so, this isn't going to work.

Yes it is interactive.   I can change that.

Yeah, if both tables A and B are filtered slices, this'll work.

Table A - (Which seems to be working) - Does not have a filtered slice.  Table B - I have a filtered slice on it because i ONLY wanted to see the rows that were of the same: [branch] and [customer] as the one selected in Table A.  But this is a interactice Dashboard.

As long as it's an interactive dashboard, it won't work.

So I just put the expression into my slice for that view AND IT NOW WORKS!  I also had it in the Format rules, but also put it in the slice.  I am going to test it some more, but it seems to be working....  Thanks STEVE!

Steve, 

   So I added a column to show the matching ticket from Table B (if there is one).  It works BUT only works if you have EXATLY the data string.

 

For example,

 If [Equipment] contains the data - "193865" - IT WORKS:

Tiger1_0-1731701240068.png

However, you you have anything more added in [Equipment] - It now doesn't work:

Tiger1_1-1731701313608.png

How can I fix this?

 

How would you instruct a human to do it? Knowing that will guide my answer.

I want to be able to find the correct Dispatch ticket that has ANY matching string in the [equipment] column in the [note] column of THAT dispatch ticket.  I want to display that in my Virtual Column [Matching Dispatch Ticket].  Does that make sense?

I want to add,

  This is what I have and it works, but just doesn't work when something else is added (Mentioned above)

SELECT(Backup Dispatch Query[Dispatch_Ticket],
AND(
[Closed_Status] = "open",
CONTAINS([Notes], [_THISROW].[equipment]),
[_THISROW].[Company Name] = [Customer_Name]
)
)

 

Steve,

  Could it be my slice on that view?

Steve
Platinum 5
Platinum 5

@Tiger1 wrote:

Does that make sense?


Nope. This is the first I've heard of a Note column.

 

Sorry - I changed [Item_list] to [notes] column.   

How would a human match that equipment value, 193865 pump, to values in the Notes columns of rows of the Backup Dispatch Query table? Do I have to know that only 193865 is what I should be matching? How would I know that? Why would I not also try to match pump?

Very good questions.  I need to think about this.  I am really not sure.  But you are right.  How would I know which to match.