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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load error - Using functions in script???



Hi everyone, I'm trying to create a table of monthyl minutes which is linked to the calendar but I get error messages. Any thought why this is not working?

LOAD

MonthYear

,

NetworkDays

(monthstart(Min(MonthYear)), monthend(MAX(MonthYear))) *24*60 as

MonthlyMinutes

RESIDENT

MasterCalendar;





2 Replies
Not applicable
Author

Hi,

your problem are the Min (Max) function in the table. Min (Max) are aggregation functions and used in a table with other fields will force you to use a GROUP BY.

To avoid this do the following:

First load Min and Max Date in a single table.

MinMaxDate:

Load

Min(Date) as MinDate,

Max(Date) as MaxDate

Resident MasterCalendar;

Second store the values in a variable.

LET varMinDate = Num(Peek('MinDate', 0, 'MinMaxDate'));
LET varMaxDate = Num(Peek('MaxDate', -1, 'MinMaxDate'));

Use the variable in your table.

LOAD
MontYear,
NetworkDays($(varMinDate),$(varMaxDate))*24*60 as MonthlyMinutes
RESIDENT MasterCalendar;

Not applicable
Author

Hello ,

What are the values you are taking in the MonthYear field as the Monthstart, Monthend and Networkdays always take full date not just Monthand Year.

If possible upload the sample of the application

Talha