6 Replies Latest reply: May 12, 2016 5:28 PM by Stefan Wühl RSS

    getting error while loading data in script :Not able to load data.

    Supriya R

      I am trying to load data by creating a variable and assigning set expression to that variable.But after loading it shows me error in loading :unknown error

       

      My variable

       

      Let varCourse_Completed_Count = sum({$<DateType = {completion}, final_test_status={'passed'},client_name={'sdsdcom'},

      MonthPeriod1 = {"<$(=Date(MonthStart(weekend(Today())),'MMM-YY'))"}>}course_completed);

       

      Cant i assigned setexpression value to variable.Please help me in this regard

       

       

      Regards,

      Supriya

        • Re: getting error while loading data in script :Not able to load data.
          srinivas jonnakuti

          Use single Quotes at DateType = {'completion'}

          • Re: getting error while loading data in script :Not able to load data.
            Stefan Wühl

            There are two issues here:

             

            - QlikSense will try to expand the dollar sign expansion $(=Date(MonthStart(weekend(Today())),'MMM-YY')) in your script, but =Date(MonthStart(weekend(Today())),'MMM-YY' is not an existing variable name, so it can't be expanded.

             

            - Second, your LET statement tells QlikSense to evaluate the part after the equal sign, but sum() is not allowed outside a LOAD statement.

             

            I think you want to assign the expression text as text to the variable, there are multiple approaches to avoid the issues (e.g. load your expression text values from an excel file).

             

            Or try

             

            Let varCourse_Completed_Count = 'sum({$<DateType = {completion}, final_test_status={''passed''},client_name={''sdsdcom''},

            MonthPeriod1 = {"<$' &'(=Date(MonthStart(weekend(Today())),''MMM-YY''))"}>}course_completed)';

             

            Note that I've also replaced your existing single quotes with two single quotes.

              • Re: getting error while loading data in script :Not able to load data.
                Supriya R

                Hi swuehl,

                 

                Thankyou very much for your clear explaination and answer,

                 

                With your answer i am trying to check condition in if else statement,but i am not getting any value in text box.What is going wrong in code.Please help me.

                 

                Let varCourse_Completed_Count = 'sum({$<DateType = {completion}, final_test_status={''passed''},client_name={''sdsdcom''},

                MonthPeriod1 = {"<$' &'(=Date(MonthStart(weekend(Today())),''MMM-YY''))"}>}course_completed)';

                 

                Let varCourse_Signed_Count = 'count({$<user_signed={1},client_name={"sdsdcom"}, DateType = {''signed''},

                MonthPeriod1 = {"<$' &'(=Date(MonthStart(weekend(Today())),''MMM-YY''))"}>}user_signed)';

                 

                 

                If(Sign($(varCourse_Signed_Count) - $(varCourse_Completed_Count))=-1) OR (Sign($(varCourse_Signed_Count) - $(varCourse_Completed_Count))= 0) THEN

                LET vPartial_Count_Weekly = 0.1 ;

                ELSE

                LET vPartial_Count_Weekly = ($(varCourse_Signed_Count)-$(varCourse_Completed_Count));

                ENDIF

                 

                 

                Regards,

                Supriya R