# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
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:

*,

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

Resident Overview_Milestone;

drop table Overview_Milestone;

thanks

Bhavesh

Tags (2)
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:

*,

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.

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:

*,

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:

*,

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.

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

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