3 Replies Latest reply: Feb 5, 2014 9:25 PM by Paul Yeo RSS

    My script i miss " ' " it does pop up error msg ?

      Hi All

       

      My script is not correct , but QV does not pop up error msg , and it just never run script. it is a bug ? As it take me quite some time to figure out where go wrong ?

      word hv 2 color final.png

        • Re: My script i miss " ' " it does pop up error msg ?
          Srikanth P

          Hi Paul, You are using SET function and its nor shown error message. Its only string representation.

           

          If you are using only single quote (') and until next quote all the script read into that variable.

           

          Ex:

           

          SET vVariable  = 'XS_2013 ;

           

          LOAD * FROM FILE;

           

          If you reload this qvw, the vVaraible holds entire script from single quote to end of the script.

           

          Which version of Qlikview you are using ?

          • Re: My script i miss " ' " it does pop up error msg ?
            Sokkorn Cheav

            Hi Paul,

             

            Here is different:

            SET just assigns the value as string whatever you give.

            LET evaluates the expresion and assigns it to the variable.

            Ex:

            SET vString = 'Qlik' & 'View'  -> vString will return QlikView

            LET vNumber = 1 + 2 -> vNumber will return 3

             

            For color, I'm not sure about this. It can be from your script line or can be a bug.

             

            For reload script, yes, it right, script line run without error. In your case, all script line after vFile2012a will consideer as a string value for your variable.

             

            To understand more, my suggestion is create new app and use only this part:

             

            SET vFile9 = 'X_OD';

            SET vFile2013 = 'X_OD_2013';

            SET vFile2012a = 'X_OD_2012;

            SET vFile2011 = 'X_OD_2011';

            SET vFile10 = 'X_OD_2010';

            SET vFile11 = 'X_OD_2009';

            SET vFile111 = 'X_OD_2008';

             

            After load script, only three variables (vFile9, vFile2013 and vFile2012a) will return value:

            vFile9 = 'X_OD'

            vFile2013 = 'X_OD_2013'

            vFile2012a = 'X_OD_2012

            SET vFile2011 = 'X_OD_2011';

            SET vFile10 = 'X_OD_2010';

            SET vFile11 = 'X_OD_2009';

            SET vFile111 = 'X_OD_2008';

             

            Regards,

            Sokkorn

              • Re: My script i miss " ' " it does pop up error msg ?

                Hi Thank you all reply.

                 

                I found the issue, after i remove the below line of code , now work fine. not so sure what the below line of code work ? it seem to me , it just load my previous sales QVD file.

                 

                //store sales_table into sales_table.qvd (qvd);

                //Drop Table sales_table;

                //sales_table:

                //Load *,                                    //Preceding Load on

                //if(Exists(company),0,1) as NewFlag;       //  Preceding Load

                //LOAD * FROM sales_table.qvd (qvd);