4 Replies Latest reply: Oct 12, 2017 8:03 AM by Abirami Palanisamy RSS

    ODAG - Qliksense Template Application Code

    Abirami Palanisamy

      Hi Everyone,

       

      I want to create a ODAG application that will restrict one period , one geography , multiple product values. and i am using direct discovery to pull the data.

       

      I am using below mentioned code. it is working fine with normal extraction code. but when i am using Direct discovery method this code is not working.


      Can anyone please help me.


      SUB ExtendWhere(Name, ValVarName)

        LET T = Name & '_COLNAME';

        LET ColName = $(T);

        LET Values = $(ValVarName);

        IF len(Values) > 0 THEN

        IF len(WHERE_PART) > 0 THEN

          LET WHERE_PART = '$(WHERE_PART) AND $(ColName) IN ( $(Values) )';

          ELSE

          LET WHERE_PART = ' WHERE $(ColName) IN ( $(Values) )';

          ENDIF

        ENDIF

      END SUB;

       

      SET Period = ;

      SET Period = $(odso_Period);

      SET Period_COLNAME='Period';

       

      SET Geography = ;

      SET Geography = $(odso_Geography);

      SET Geography_COLNAME='Geography';

       

      SET PROD = ;

      SET PROD = $(odso_PROD);

      SET PROD_COLNAME='PROD';

       

      SET WHERE_PART = '';

       

      FOR EACH fldname IN 'Period', 'Geography','PROD'

        LET vallist = $($(fldname));

        WHEN (IsNull(vallist)) LET vallist = '';

        IF len(vallist) > 0 THEN

          CALL ExtendWhere('$(fldname)','vallist');

        ENDIF

      NEXT fldname

       

      TRACE Generated WHERE clause: ;

      TRACE $(WHERE_PART);

       

       

       

      Thank you in advance.