Expression for column that lists empty columns

I have two tables: Table 1 & Table 2.

Table 2 has 4 columns :

Column: A 

Column: B

Column: C

Column: D

Id like to create an expression in Table 1 that lists that name of the columns in table 2 that are empty within that row.

In the example table below, โ€œXXXXโ€ represents the data. The column in table 1 shows the names of the columns in table 2 with no data in that row. 

 02BEECEE-E3CB-46C9-B3E9-A67FB55817D2.jpeg

I am a novice and haven it a good crack with the following expression:

LIST(
IF(
AND(
CONTAINS(
Table2[ROW ID],[_THISROW].[ROW ID]), TRUE,
ISBLANK(
Table1[A]), TRUE), โ€œ Aโ€, โ€œโ€),

IF( 

AND(
CONTAINS(
Table2[ROW ID],[_THISROW].[ROW ID]), TRUE,
ISBLANK(
Table1[B]), TRUE), โ€œ Bโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Table2[ROW ID],[_THISROW].[ROW ID]), TRUE,
ISBLANK(
Table1[C]), TRUE), โ€œ Cโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Table2[ROW ID],[_THISROW].[ROW ID]), TRUE,
ISBLANK(
Table1[D]), TRUE), โ€œ Dโ€, โ€œโ€))

Any help would be much appreciated!

Solved Solved
0 6 251
1 ACCEPTED SOLUTION

LIST(
IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Paraphrase Lecture notes])), โ€œ Paraphrase Lecture notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Lecture notes reference source])), โ€œ Lecture notes reference sourceโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Lecture notes Condensed point])), โ€œ Lecture notes Condensed pointโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]), TRUE,
ISNOTBLANK(
Index[My notes]),
ISBLANK(
Index[Personal Notes Reference source])),โ€œ Personal Notes Reference sourceโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]), TRUE,
ISNOTBLANK(
Index[My notes]),
ISBLANK(
Index[Personal Notes Condensed point])),โ€œ Personal Notes Condensed pointโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Research notes])), โ€œ Research notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Paraphrase Research notes])), โ€œ Paraphrase Research notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Research notes Reference source])), โ€œ Research notes Reference sourceโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Research notes Condensed point])), โ€œ Research notes Condensed pointโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Statistics notes])), โ€œ Statistics notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Statistics notes])), โ€œ Statistics notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Paraphrase Statistics notes])), โ€œParaphrase Statistics notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Statistics notes Reference source])), โ€œ Statistics notes Reference sourceโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Statistics notes Condensed point])), โ€œ Statistics notes Condensed pointโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Informed opinion])), โ€œ Informed opinionโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Informed opinion reference source])), โ€œ Informed opinion reference sourceโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Informed opinion Condensed point])), โ€œ Informed opinion Condensed pointโ€, โ€œโ€),

)

View solution in original post

6 REPLIES 6

It's unclear whether you've tried your expression and, if so, what problem you observed.

Regardless, without having tried to parse your expression, here's an approach to consider:

  • Ensure Table 1 references Table 2.
  • Depending on the direction of your intertable reference, use an expression like one of the following to evaluate whether a Table 2 column is blank.
ISBLANK([Table 2 ID].[A])
ISBLANK([Related Table 2s][A])

thanks for replying!

the tables are referenced but by a different column. My example was a condensed and redacted version of what Iโ€™m trying to achieve but I appreciate how hard it is to give guidance without the full picture so my bad.
The expression works and has a green tick in the expression checker but I know this doesnโ€™t always mean it will have the right results. Like I said Iโ€™m a novice so Iโ€™m working on common sense and YouTube videos. From what Iโ€™ve learnt, my understanding is that the IF( statements need to be connected with a AND or OR like in the picture attached?1366306E-7AB1-4262-AAFF-425A0733AC8D.jpeg

I could be completely wrong, Iโ€™ve tried to add both and the expression strops working because is says the expression needs to have a true or false value. So Iโ€™m a little stuck..

The tables donโ€™t have any data yet and Iโ€™m not sure how to check that it would actually return the right results. But Iโ€™d like it to display the values like in my example table with commas as separators. With my limited knowledge and lack of data itโ€™s hard to know if the e expression would produce that.

I think this might be one of those things thatโ€™s I just wing it for now and come back to once Iโ€™m further along. But if you can make sense of my laymanโ€™s babble, any help you can give would be much appreciated!

No, you don't need and/or between the list items. You just need an appropriate expression for each list item. Like:

IFS( 
  ISBLANK( LOOKUP( [_THISROW].[row id] , table 2 , row id , a) ,
  "A"
)

 

 

when I replace โ€œtable 2โ€ with the table name , it says โ€œexpression cannot be parsed due to unrecognisable token โ€œtable 2โ€

which is strange because Iโ€™ve never seen that error before.  So I have no idea what it means or how to fix it.

I tried this expression on another table to see if it would work and it says that โ€œIBLANKโ€ is used incorrectly. Iโ€™m out of my depth I think..

 Will the original expression that I posted successfully create a list separated by commas if I donโ€™t add AND( between the ifs?

if so I just might keep it

Steve
Platinum 5
Platinum 5
(
  LIST(
    IFS(ISBLANK(LOOKUP([_THISROW].[Row Number], "Table 2", "Row Number", "A")), "A"),
    IFS(ISBLANK(LOOKUP([_THISROW].[Row Number], "Table 2", "Row Number", "B")), "B"),
    IFS(ISBLANK(LOOKUP([_THISROW].[Row Number], "Table 2", "Row Number", "C")), "C"),
    IFS(ISBLANK(LOOKUP([_THISROW].[Row Number], "Table 2", "Row Number", "D")), "D"),
  )
  - LIST("")
)

LIST(
IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Paraphrase Lecture notes])), โ€œ Paraphrase Lecture notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Lecture notes reference source])), โ€œ Lecture notes reference sourceโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Lecture notes Condensed point])), โ€œ Lecture notes Condensed pointโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]), TRUE,
ISNOTBLANK(
Index[My notes]),
ISBLANK(
Index[Personal Notes Reference source])),โ€œ Personal Notes Reference sourceโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]), TRUE,
ISNOTBLANK(
Index[My notes]),
ISBLANK(
Index[Personal Notes Condensed point])),โ€œ Personal Notes Condensed pointโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Research notes])), โ€œ Research notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Paraphrase Research notes])), โ€œ Paraphrase Research notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Research notes Reference source])), โ€œ Research notes Reference sourceโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Research notes Condensed point])), โ€œ Research notes Condensed pointโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Statistics notes])), โ€œ Statistics notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Statistics notes])), โ€œ Statistics notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Paraphrase Statistics notes])), โ€œParaphrase Statistics notesโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Statistics notes Reference source])), โ€œ Statistics notes Reference sourceโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Statistics notes Condensed point])), โ€œ Statistics notes Condensed pointโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Informed opinion])), โ€œ Informed opinionโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Informed opinion reference source])), โ€œ Informed opinion reference sourceโ€, โ€œโ€),

IF(
AND(
CONTAINS(
Index[Lecture ID],[_THISROW].[Lecture ID]),
ISBLANK(
Index[Informed opinion Condensed point])), โ€œ Informed opinion Condensed pointโ€, โ€œโ€),

)

Top Labels in this Space