Select rows from table 1 that don't exist on table 2 where the id of table 1 equals the selected id

Hi!

I'm a little bit confused with this. 
I'm trying to select the column A from table 1 where the table 1 id equals the id selected in the form (it's a ref column); however, I need that the values retrieved don't exist in table 2 (here's where we are going to save the form's results)

I've tried different things without success. 

SELECT(Table 1[A],AND([_THISROW].[Id]=[Id],NOT(IN([A], SELECT(Table 2[A],[_THISROW].[Id]=[Id], TRUE))),TRUE))

I'm not sure what I'm doing wrong.

0 3 226
3 REPLIES 3

Hey @Gigi12 

If your field in your form is a ref, you can use dereferences to get values from the record you selected.

[Ref_Column].[Table_A_Column]

You might also consider implementing data subsets; these are slices of records that match a high-level filter criteria - think: [Order_Status] = "Complete" - which you can then bring into an additional VC with a REF_ROWS()

 

 

REF_ROWS("Slice_Name", "Ref_Column")

 

  • This can then provide you with a subset of records for your Parent_Ref record, holding the records that match that criteria.  This can give you a way to separate out what's "done" from "not done" - or whatever you're trying to do.  Without any insight into what you're actually trying to accomplish, a specific answer can be difficult to come to.

--------------------------------------------------

FYI: providing actual table and column names are preferable, as they will help with inference into your data schema, intent, etc. A lot can be inferred about your system, which can be vital to filling in the blanks when answering your question.

Sure, 

I only have two tables. 

Question table:

Gigi12_0-1693436223085.png

Form Table

Gigi12_1-1693436795108.png

 

Questions [Form Id] is my ref column with forms (id)
I need to bring all the questions from the column Question in Forms where the id selected in the question's form equals the form's id. 

For those questions, I need to make sure not to show anything that was already registered in the Question table for the specific form ID. 

Hi @Gigi12 ,

Request you to post such questions in the "Q&A" section.

Thank you

Top Labels in this Space