4 Replies Latest reply: Aug 17, 2016 1:14 PM by Tim Kendrick RSS

    Script load error in qliksense

    Supriya R

      Hi,

       

      i have a expression  as shown below

       

      sum({$<CanonicalDate = {"$(='>=' & Date(MonthStart(Max(CanonicalDate ))) & '<=' & Date(Max(CanonicalDate)))"},

      client_name = {'Parlegi'},final_test_status={'passed'}>} course_completed)

       

      Now i am loading above expression in script as shown below

       

      Let val = 'sum({$<CanonicalDate = {"$' &'(='>=' & Date(MonthStart(Max(CanonicalDate ))) & '<=' & Date(Max(CanonicalDate)))"},

      client_name = {''Parlegi''},final_test_status={''passed''}>} course_completed)';

       

      But while loading it gives me error.

       

      What is wrong i am doing in script, to load expression.

        • Re: Script load error in qliksense
          Prashanth Reddy

          Hi,

          I think you cannot perform set analysis in script.

          Instead do one thing, take the resident of the dimensions you are calculating on do summation in the resident table and try grouping.

          Ex:

          TmpTable:

          Load

          CanonicalDate ,

          client_name ,

          final_test_status,

          if(CanonicalDate <= max(CanonicalDate ), sum(course_completed))  as course_completed


          resident MainTable

          group by

          CanonicalDate ,

          client_name ,

          final_test_status

          ;

          • Re: Script load error in qliksense
            Kaushik Solanki

            Hi,

             

            Try this.

             

            Let val = 'sum({$<CanonicalDate = {">=$(=Date(MonthStart(Max(CanonicalDate ))) <= Date(Max(CanonicalDate)))"},

            client_name = {''Parlegi''},final_test_status={''passed''}>} course_completed)';

             

            Regards,

            Kaushik Solanki

            • Re: Script load error in qliksense
              Tim Kendrick

              This may be better suited for a Variable defined outside of the data load editor.

               

              The Let command expects whatever is after the = sign to be an expression which can be evaluated, but you are passing it a string. If you were to use the Set command, it expects a string after the = sign, which it will assign to the variable. First suggestion is to test in your application that the expression actually works. Then remove the single quotes (') from around the expression in the Let statement. Finally, if all else fails, define the variable in the application outside of the data load editor (because it may not allow set analysis in the data load editor.

              • Re: Script load error in qliksense
                Tim Kendrick

                This person posted a very similar question. Though no explanation on how it works...

                 

                Variable in load editor with Set analysis expression