Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
rudywelvaert
New Contributor III

Evaluate()

Hi,

In my script I use this code

SET Lang= '$(Teamleader_Lang)';
LET MonthNames = Evaluate(If('$(Lang)' = 'F','jan;fév;mar;avr;mai;jun;jul;aoû;sep;oct;nov;déc', 'Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec'));

I get this error:

Error: Error in expression:

EVALUATE is not a valid function

I thought Evaluate() is a valid function is script. How can this be? Is there an alternative?

It doesnt change a thing when I use:

SET MonthNames = Evaluate(If('$(Lang)' = 'F','jan;fév;mar;avr;mai;jun;jul;aoû;sep;oct;nov;déc', 'Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec'));

Thanks

RW

4 Replies
Gabriel
Valued Contributor II

Re: Evaluate()

Hi,

What are you trying to achieve?

Evaluate might not be the right function to use here.

May be remove the Evaluate function and run the script

Re: Evaluate()

There is a good example given from Qlik to manage MultiLanguage documents:

Re: Evaluate()

Hi,

May be you want like this?

//SET MonthNames='ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic';

SET DayNames='lun;mar;mié;jue;vie;sáb;dom';

LET Teamleader_Lang='F';

SET Lang= '$(Teamleader_Lang)';

if(Lang='F') then

  SET MonthNames='jan;fév;mar;avr;mai;jun;jul;aoû;sep;oct;nov;déc';

ELSE

  SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec');

ENDIF

rudywelvaert
New Contributor III

Re: Evaluate()

Hi Settu,

This I tried, but it didn't work. MonthNames is a system variable, it doesn't react the same way as custom variables.

But I have found a work around:

SET MonthNamesN='jan','feb','mrt','apr','mei','jun','jul','aug','sep','okt','nov','dec';
SET MonthNamesF='jan','fév','mar','avr','mai','jun','jul','aôu','sep','oct','nov','déc';

=If($(vLanguage)='F',Pick(Month(Month_From),$(MonthNamesF)),Pick(Month(Month_From),$(MonthNamesN))) & ' ' & Year(Month_From)

RW

Community Browser