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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

conditional include statement

if we if condition

like

if ( compname() 'test') then

one include statement has to execute

else

another include statement has to execute

this is my concern ,

please help me in this .

i tried from my side but only my else statement working .

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

The two include statements include the same file. and (I think) they cannot be empty.

And you need an End If (or ENDIF) statement after the second include.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

if (condition, true, false)

this is the syntax to be used

Anonymous
Not applicable
Author

can you Show your complet if Expression

compname is not a function (or is it a macro?),

and copname Needs a comparison (or you just forgot it)

if (compname='test' then

   include1

else

  include2

endif

what does compname contains?

Not applicable
Author

thanks for your reply ,

see basically i m using

if condition and in that i m including the include statement which has the qvs scripts

i have two include statement which has two qvs scripts based on condition it should   take

first condition then it execute , or else it should execute the else statement include statement .

problem is that if it passes the condition then it should execute the  first condition or else else condition

but only else statement is executing

ex :

IF wildmatch(ComputerName(),'*QVTEST*','*QVDEV*') THEN

$(must_include=\\computer\Qlikview Dashboard Template.qvs);

ELSE

$(must_include=\\computer\Qlikview Dashboard Template.qvs);

alexandros17
Partner - Champion III
Partner - Champion III

If Month(Today())=7 then
$(Include=..\_Common Code\Source\Variables Main.txt);
$(Include=..\_Common Code\Source\Variables Shared.txt);
$(Include=..\_Common Code\Source\Document Changes.txt);
ELSEIF
....

ENDIF

Anonymous
Not applicable
Author

your Statement looks good so far

what are the values for computername?

jonathandienst
Partner - Champion III
Partner - Champion III

The two include statements include the same file. and (I think) they cannot be empty.

And you need an End If (or ENDIF) statement after the second include.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sasiparupudi1
Master III
Master III

IF wildmatch(ComputerName(),'*QVTEST*','*QVDEV*')=1 THEN

EXECUTE file on *QVTEST*

ELSE

EXECUTE file on *QVDEV*

ENDIF

settu_periasamy
Master III
Master III

Hi,

Your TRUE and FALSE include statment looks same to me. or am i look wrong?

but only else statement is executing

ex :

IF wildmatch(ComputerName(),'*QVTEST*','*QVDEV*') THEN

$(must_include=\\computer\Qlikview Dashboard Template.qvs);

ELSE

$(must_include=\\computer\Qlikview Dashboard Template.qvs);