0 Replies Latest reply: Jan 13, 2015 3:53 PM by Gowri Shankar RSS

    Nested IF Statement in QMC

    Gowri Shankar

      Hello Experts,

      Recently I faced an issue with nested IF statement (QlikView 11.2 SR 5) and want to know whether is it a known bug.

      Let me explain with an example, the below nested IF statement works fine with Desktop client, but throws "General Script Line Error" when triggered from QMC.

       

      (Works in Desktop client but not in QMC)

      IF Not IsNull(QvdCreateTime('$(vQVDPath)Fact_$(I).qvd')) THEN

        IF $(I)=1 THEN

          Fact:

          LOAD *

          From [$(vQVDPath)Fact_$(I).qvd] (qvd);

        ELSE

          Concatenate (Fact)

          LOAD *

          From [$(vQVDPath)Fact_$(I).qvd] (qvd);

        ENDIF;

      ENDIF;

       

      When I reorganize the above code as below then it works in QMC.

      (Works in QMC aswell)

      IF Not IsNull(QvdCreateTime('$(vQVDPath)Fact_$(I).qvd')) and ($(I)=1) THEN

        Fact:

        LOAD *

        From [$(vQVDPath)Fact_$(I).qvd] (qvd);

      ELSEIF Not IsNull(QvdCreateTime('$(vQVDPath)Fact_$(I).qvd')) THEN

        Concatenate (Fact)

        LOAD *

        From [$(vQVDPath)Fact_$(I).qvd] (qvd);

      ENDIF;

       

      So, QMC is having some issue in compiling the Nested IF statement.

       

      Thanks

      Gowri Shankar