Find the nth occurrence in this row and lookup display name

Hi all, how would i write this expression:
If this row contains FALSE find the 1st occurrence of FALSE and copy that column display name into this text field

This expression will run in the action (add a new row to another table using values from this row) and will work against the table screenshot below, the columns that contain the TRUE, FALSE data are the columns I want to query

The action will copy the data into a Failures table, you can see I have highlighted the desired results green

Iโ€™m thinking i need some blended version of INDEX, FILTER, and maybe LOOKUP to find the display name, but so far no luck, can anybody shove me in the right direction?

Cheers,
Steve

0 4 234
4 REPLIES 4

Hereโ€™s an idea for how to get fail_1:

index(
	unique(
		list(
			if([surface]=FALSE,"surface",""),
			if([lubricate]=FALSE,"lubricated",""),
			if([edges]=FALSE,"edges","")
			)
		)-list("")
,1)

Iโ€™ve only typed in the first 3 categories but I hope this illustrates the idea. unique() and - list("") are necessary to completely remove all TRUE categories from the list.

Thanks Kirk, i will give this a try, i actually have used this list comparison expression before but completely forgot, much appreciated !

More concise, and without the extraneous UNIQUE() (list subtraction does that automatically):

INDEX(
  (
    LIST(
      IFS(NOT([surface]), "surface"),
      IFS(NOT([lubricated]), "lubricated"),
      IFS(NOT([edges]), "edges"),
      ...
    )
    - LIST("")
  ),
  1
)

Interesting use of IFS(), Steve. I guess the idea is that IFS() doesnโ€™t require the โ€œelseโ€ part of the expression when itโ€™s false. Iโ€™ll try to remember this.

Top Labels in this Space