Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
cristian_av
Creator III
Creator III

Error: Week takes 1 parameter

Hi

I'm reloading a script in QV Desktop without any problem.

But when it reloads in QV Server, it throws the following error:

.....

22-08-2018 10:41:47: 0991      Week(%Fecha,0,0) As SemanaZarpe,

22-08-2018 10:41:47: 0992  WeekName(%Fecha) as SemanaAñoZarpe

22-08-2018 10:41:47:       Error: Error in expression:

22-08-2018 10:41:47:       Week takes 1 parameter

....

According to the QV documentation, the week function has two parameters. I can clear the parameters, but the function will give me unwanted results.

Am I doing something wrong?

Thanks!!

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFun...

1 Solution

Accepted Solutions
ValeriyaBartosh
Partner - Contributor III
Partner - Contributor III

Hello, you can try  use variables except parameters

week(timestamp [, first_week_day [, broken_weeks [, reference_day]]])

Screenshot_2.png

Set BrokenWeeks=0; //(use unbroken weeks)

Set BrokenWeeks=1; //(use broken weeks)

SET FirstWeekDay=0;

SET FirstWeekDay=1;

View solution in original post

5 Replies
m_woolf
Master II
Master II

What is the value of %Fecha when the error occurs?

cristian_av
Creator III
Creator III
Author

No matter what value is, I've tested with 0,1, 42000 and others... with any number the error occurs.

According to this, the error is because of the version 11 only supports one parameter, and version 12 supports 4 parameters.

But.. how do I get an equivalent of the Week(%Fecha,0,0) with one parameters..?

week() with more than 1 parameter generates script error in qlikview 11

ValeriyaBartosh
Partner - Contributor III
Partner - Contributor III

Hello, you can try  use variables except parameters

week(timestamp [, first_week_day [, broken_weeks [, reference_day]]])

Screenshot_2.png

Set BrokenWeeks=0; //(use unbroken weeks)

Set BrokenWeeks=1; //(use broken weeks)

SET FirstWeekDay=0;

SET FirstWeekDay=1;

balabhaskarqlik

It's better to post some of the script pertains week() and data screenshots.

cristian_av
Creator III
Creator III
Author

The problem was QV Version.

Finally I solved following this guide:

Redefining the Week Numbers