Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

use of "if with let variables" within the script (syntax error)

Hi community stalwar1‌,

I'm trying to do sthing like this :

if( $(vNbr) >4,

Let vRequestBody = sthing1 ;

LIB CONNECT TO 'source';

do bla bla

" WITH CONNECTION(

BODY "$(vRequestBody)"

);

,

Let vRequestBody = sthing2 ;

LIB CONNECT TO 'source';

do bla bla

" WITH CONNECTION(

BODY "$(vRequestBody)"

);

)

but when I do this, It seems to be impossible (syntax error) :

see:

Capture.PNG

the question is, how can I do this otherwise?

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

if $(vNbr) >4 then

     Let vRequestBody = sthing1 ;

     LIB CONNECT TO 'source';

     do bla bla

     " WITH CONNECTION(

     BODY "$(vRequestBody)";

Else

     Let vRequestBody = sthing2 ;

     LIB CONNECT TO 'source';

     do bla bla

     " WITH CONNECTION(

     BODY "$(vRequestBody)";

EndIf

View solution in original post

2 Replies
m_woolf
Master II
Master II

if $(vNbr) >4 then

     Let vRequestBody = sthing1 ;

     LIB CONNECT TO 'source';

     do bla bla

     " WITH CONNECTION(

     BODY "$(vRequestBody)";

Else

     Let vRequestBody = sthing2 ;

     LIB CONNECT TO 'source';

     do bla bla

     " WITH CONNECTION(

     BODY "$(vRequestBody)";

EndIf

OmarBenSalem
Author

Shame on me !