Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bhaveshp90
Creator III
Creator 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
trdandamudi
Master II
Master II

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
rajivmeher
Creator
Creator

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.

trdandamudi
Master II
Master II

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.

santhana
Contributor III
Contributor III

Hi Bhavesh,

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

bhaveshp90
Creator III
Creator III
Author

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