Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Read about Qlik’s Response to COVID-19 Read the Letter, Join the Group.
Contributor III

Script error calculating the sum of values

Hello,

My below script gives me an error for Final Acceptance field as shown below.

I am trying to calculate the sum of the calc_delay values where Overview_Milestone_Point = 'Final Acceptance Complete'


Where am I doing wrong here? 

Overview_Milestone:

LOAD Project_Number &'-'& Region &'-'& if (match(Country_Name,'US','UK','Canada','SE')>0, Country_Name, Capitalize(Country_Name)) &'-'& Snapshot_Date as Project_Overview_Milestone_Key,

    Overview_Milestone_Point,

    calc_delay

FROM

(qvd);

Milestone1:

NoConcatenate load

*,

Final_Acceptance = Sum({<Overview_Milestone_Point = {'Final Acceptance Complete'}>}calc_delay)

Resident Overview_Milestone;

drop table Overview_Milestone;

thanks

Bhavesh

1 Solution

Accepted Solutions
Highlighted
Honored Contributor II

Re: Script error calculating the sum of values

May be as below:  (Note: I don't think you can use Set Analysis in the script)

Milestone1:

NoConcatenate load

*,

If(Overview_Milestone_Point ='Final Acceptance Complete',[calc_delay],0) as Final_Acceptance

Resident Overview_Milestone;

You can then do the SUM in the front end charts.

View solution in original post

4 Replies
Highlighted
Contributor

Re: Script error calculating the sum of values

Hi bhaveshp90

Shouldn't the Final_Acceptance field be as follows:


NoConcatenate

Milestone1:

load

*,

Sum({<Overview_Milestone_Point = {'Final Acceptance Complete'}>}calc_delay) AS Final_Acceptance


Resident Overview_Milestone;

drop table Overview_Milestone;

If not the case, please can you share the error that you are getting, so that it will be easier to troubleshoot?

Regards

Rajiv.

Highlighted
Honored Contributor II

Re: Script error calculating the sum of values

May be as below:  (Note: I don't think you can use Set Analysis in the script)

Milestone1:

NoConcatenate load

*,

If(Overview_Milestone_Point ='Final Acceptance Complete',[calc_delay],0) as Final_Acceptance

Resident Overview_Milestone;

You can then do the SUM in the front end charts.

View solution in original post

Highlighted
New Contributor III

Re: Script error calculating the sum of values

Hi Bhavesh,

Set Expression cannot be written in edit script,  you can write in front end

Highlighted
Contributor III

Re: Script error calculating the sum of values

thank you that worked, you are right we cannot use Set-analysis in the script itself