GraphStudio - Write Queries allow conditional "IF some value IN aSet" in DML Block

When entering in the following query code into the ‘Write Queries Editor’, GraphStudio (version 3.9.3 - on iCloud) I do not receive an error message.

However, when I compile the code. I do receive an error message that states: “nullSaved as draft query with type/semantic error:[calculateBodyMass]”

The compiler does not recognize using an “IN” as part of the IF statement.
CREATE QUERY calculateBodyMass(UINT hraID) SYNTAX v2 {
/**

  • Build out Body Mass Index
    **/
    UINT id,height, weight, bmi;

    Start = {HRA.*};

    PRS = SELECT h FROM Start:h WHERE h.id == hraID AND h.height>0 AND h.weight>0
    ACCUM bmi = (h.weight * 703)/(h.height * h.height),
    id = h.id, height = h.height, weight = h.weight
    PRS = SELECT h FROM Start:h WHERE h.id == hraID AND h.height>0 AND h.weight>0
    ACCUM bmi = (h.weight * 703)/(h.height * h.height),
    id = h.id, height = h.height, weight = h.weight
    POST-ACCUM
    SET height25 = (61,63,79,81),
    SET weight25 = (130,140,220,230),

     IF bmi > 18 AND bmi <= 25 THEN
      /*
       * Handle special case where BMI 25 crosses into Optimal boundaries
       */
          IF bmi == 25 AND height IN height25 AND weight IN weight25 THEN
            INSERT INTO BodyMass VALUES(id, bmi, height, weight, "Optimal")
          ELSE IF bmi !=25 THEN
            INSERT INTO BodyMass VALUES(id, bmi, height, weight, "Optimal")
          END
      END;
    

It seems the query editor allows “IN” statements as part of the IF THEN statement. This should be flagged as an error in the editor if the IF THEN statement doesn’t support the IN operator.

As a feature request, it would be great to have the IF condition IN a SET THEN supported.

Thanks for your feature request and for pointing out that the error detection could be better. This is a hard problem for languages in general, because it’s not always clear what the user intended or wanted. AI can help here.