0

QUERYING VALUES IN A SUBTABLE

I have two datasets - Leaders and Media - in a 1: n relationship.

I'd like a f(x) field in Leaders to check the Media files linked to a Leader file and return a value (Available / Unavailable) based on the values of choice fields in those linked Media files. 

So, for example:

If any of the linked Media files fulfils certain conditions (returns "Magazine" in the choice field Output, does not return "Used" in the field State, and the image field PIC 1 is not empty) then the value is Available, otherwise Unavailable.

I know this should be basically an IF/ELSE formula, but can someone confirm it's the best way to do this and give me some script to start from?

2 replies

null
    • Birger_H
    • 4 yrs ago
    • Reported - view

    Try a formula field. This would be the code:
    –––
    if cnt(Media[text('Output') like "magazine"]) >0 and 'State' not like "used" and 'PIC 1' then 
       1
    else
       0
    end
    –––

    Birger

    • David
    • 4 yrs ago
    • Reported - view

    Brilliant. Thanks!

Content aside

  • 4 yrs agoLast active
  • 2Replies
  • 1151Views