3 Replies Latest reply: Nov 5, 2013 5:14 AM by Stephen Matthews RSS

    How to use value of the variable in load script?

    John Gu

      I want to let users to reload data by company level they selected.

       

      variable:

      vCom_L = GetFieldSelections(com_level,',')

       

       

       

      Load script:

       

      SQL select company,com_level from Dim_Company

      where com_level in $(vCom_L);

       

      SQL select distinct com_level from Dim_Company;

        • Re: How to use value of the variable in load script?
          Tresesco B

          You can't get the field selection in the script directly like you tried. Have a look at this link , explained very nicely.

          • Re: How to use value of the variable in load script?
            Sushil Kumar

            Hi John,

             

            You need to store your selection in a table and then have to reload the application...

             

            otherwise there is no direct way to include the UI variables into script directly.

             

            HTH

            Sushil

            • Re: How to use value of the variable in load script?

              Hi

               

              There are a few ways of doing this.  I'll quickly list them as you may prefer one over another;

               

              1) Your code above looks almost sound as long as you only allow one  selection on com_Level.  But I'd advise not loading from your SQL DB directly as this may affect performance of your source system.  It would be more efficient and simpler to have this SQL table stored into a qvd and load from this, use formula;

               

              vCom_L= GetFieldSelections(com_Level)

               

              2) Hide all your tabs and only show them after your use has performed a data reduction (i.e. Have them open the fully populated qvw but do not allow them access to any functionality via conditional hides until they have performed this data reduction).

               

              3)  Provide a selection box and a reload button to make the selection easier for you users.  (This is similar to option 1).  I have attached an example so that you may see the logic of the load script.

               

              I hope this helps, let me know how you get on.

               


              Regards


              Steve