Filtering based on the desired value from a reference table.

1122

gogle sheets  database

Hello, I am a search and rescue volunteer. I need an application that can count and list volunteers entering and exiting the disaster area. I got the counting part done, but I'm having trouble creating a list. Can you please help me with this? Thank you!

 

 

SELECT(gรผvenlik[Gรถnรผllรผ adฤฑ], 
AND([Durum] = "GฤฐRฤฐลž", [maps id] = LOOKUP([_THISROW], "gรผvenlik", "maps id", "maps id")))

 

 

I can filter and count based on the desired value using this formula. However, I'm having trouble excluding entries where the [Durum] = "ร‡IKIลž". I created two virtual columns for entry and exit and listed them separately. Then I tried another virtual column, but still couldn't solve it. What is your suggestion? (DURUM=STATUS, GฤฐRฤฐลž=ENTER, ร‡IKIลž=EXฤฐT; turkish) 

Solved Solved
0 6 313
1 ACCEPTED SOLUTION

INTERSECT(
INTERSECT(
SELECT(gรผvenlik[Gรถnรผllรผ adฤฑ], [Durum] = "GฤฐRฤฐลž"),
SELECT(gรผvenlik[Gรถnรผllรผ adฤฑ], [maps id] = [_THISROW].[MapKey])
),
INTERSECT(
SELECT(gรผvenlik[Gรถnรผllรผ adฤฑ], [Durum] = "ร‡IKIลž"),
SELECT(gรผvenlik[Gรถnรผllรผ adฤฑ], [maps id] = [_THISROW].[MapKey])
)
)

View solution in original post

6 REPLIES 6

Not 100% sure what you are looking for. Your existing SELECT() formula should already exclude "Exits" away as it's looking only Enters. Would you please elaborate your case, thanks.

Hi but; 

test2 ----------SELECT(gรผvenlik[Gรถnรผllรผ adฤฑ],
AND([Durum] = "GฤฐRฤฐลž", [maps id] = LOOKUP([_THISROW], "gรผvenlik", "maps id", "maps id")))

2.png

Adsฤฑz.png

I need a formula that will show only the volunteer named Veli. because he entered the field and did not leave.

Here might be an approach:

  • Make a virtual column [Virtual ID] to identify the volunteer and map for a unique id:  [Gรถnรผllรผ id]&[maps id]
  • Make a slice "ร‡IKIลž" for "ร‡IKIลž" on the gรผvenlik table with the expression: [Durum]= "ร‡IKIลž"
  • Make a virtual column for [Current Status] with the expression: IF(IN([Virtual ID],ร‡IKIลž[Virtual ID],"ร‡IKIลž","GฤฐRฤฐลž"))
  • Use the [Current Status] to filter 

Thank you for your suggestion. However, the work areas are separate. The (maps id) entry table will not be common, the people entering and exiting each field will be listed separately, so I need to use a reference table.

SELECT DISTINCT gรผvenlik[Gรถnรผllรผ adฤฑ]
WHERE AND(
[Durum] = "GฤฐRฤฐลž",
[maps id] NOT IN (
SELECT DISTINCT gรผvenlik[maps id]
WHERE AND(
[Durum] = "ร‡IKIลž",
[maps id] = LOOKUP([_THISROW], "gรผvenlik", "maps id", "maps id")
)
)
)

gemini ai gave this formula but it was not solved ๐Ÿ™‚

INTERSECT(
INTERSECT(
SELECT(gรผvenlik[Gรถnรผllรผ adฤฑ], [Durum] = "GฤฐRฤฐลž"),
SELECT(gรผvenlik[Gรถnรผllรผ adฤฑ], [maps id] = [_THISROW].[MapKey])
),
INTERSECT(
SELECT(gรผvenlik[Gรถnรผllรผ adฤฑ], [Durum] = "ร‡IKIลž"),
SELECT(gรผvenlik[Gรถnรผllรผ adฤฑ], [maps id] = [_THISROW].[MapKey])
)
)

Top Labels in this Space