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: 
rudywelvaert
Creator
Creator

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
Partner - Specialist III
Partner - Specialist III

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

alexandros17
Partner - Champion III
Partner - Champion III

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

settu_periasamy
Master III
Master III

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

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