Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

General Script Error on Resident Load

Getting a General Script Error on a simple RESIDENT Load.  This is the first time I've tried RESIDENT Loading so I anticipate I may have a simple syntactical issue here, unfortunately the Log file provides no useful info on the error other than stating its a General Script Error and Debugger doesn't seem to provide any additional info on the problem either  

Here is my LOAD statement:

NET30DELTA:

LOAD
  (
SUM(AVERAGE_DELTA)/COUNT(AVERAGE_DELTA)) AS AVGGROWTH
  
RESIDENT DISC_USAGE
 
WHERE DISC_DATE >=  AddMonths(MAX(DISC_DATE),-1)
;

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Using an aggregation function in the where clause is most likely the problem.

WHERE DISC_DATE >=  AddMonths(MAX(DISC_DATE),-1)

You can try using a variable instead:

Temp:

load Max(DISC_DATE) as MaxDiscDate

from ...disc_usage_source...;

LET vMaxDD = addmonths(peek('MaxDiscDate'),-1);

drop table Temp;

LOAD

  (SUM(AVERAGE_DELTA)/COUNT(AVERAGE_DELTA)) AS AVGGROWTH

   RESIDENT DISC_USAGE

  WHERE DISC_DATE >=  $(vMaxDD);


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
montero91
Creator
Creator

Hi Lew

is not an error in a table resident,

you're doing grouping operations(sum, Count) without a GROUP BY

for any field

example month

NET30DELTA:

LOAD
(
SUM(AVERAGE_DELTA)/COUNT(AVERAGE_DELTA)) AS AVGGROWTH ,

Month,
RESIDENT DISC_USAGE
WHERE DISC_DATE >= AddMonths(MAX(DISC_DATE),-1)

Group by Month;

Not applicable
Author

Hello Manuel,

Thanks for your reply.  I have applied your recomendation and added another column to use for Grouping, yet I still get the failure.  Here is what I see in the Log.

1/29/2013 1:33:34 PM: 0148  NET30_DELTA:
1/29/2013 1:33:34 PM: 0149  LOAD
1/29/2013 1:33:34 PM: 0150    SRC_SYS_CD,

1/29/2013 1:33:34 PM: 0151    (SUM(AVERAGE_DELTA)/COUNT(AVERAGE_DELTA)) AS AVG_GROWTH30
1/29/2013 1:33:34 PM: 0152     RESIDENT DISC_USAGE
1/29/2013 1:33:34 PM: 0153    WHERE DISC_DATE >= AddMonths(MAX(DISC_DATE),-1)
1/29/2013 1:33:34 PM: 0154    Group By SRC_SYS_CD

1/29/2013 1:33:34 PM:       General Script Error
1/29/2013 1:33:34 PM:       Execution Failed

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Using an aggregation function in the where clause is most likely the problem.

WHERE DISC_DATE >=  AddMonths(MAX(DISC_DATE),-1)

You can try using a variable instead:

Temp:

load Max(DISC_DATE) as MaxDiscDate

from ...disc_usage_source...;

LET vMaxDD = addmonths(peek('MaxDiscDate'),-1);

drop table Temp;

LOAD

  (SUM(AVERAGE_DELTA)/COUNT(AVERAGE_DELTA)) AS AVGGROWTH

   RESIDENT DISC_USAGE

  WHERE DISC_DATE >=  $(vMaxDD);


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

I commend your QV Skills...that seems to have done the trick!  Thanks for your assistance, I'm not so sure I would have figured this one out on my own.

Best Regards,

Lew