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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
rdsuperlike
Creator
Creator

If else syntax error in script

Wat is the issue in this code? I have kept it in the script

I am getting error related to If and else. Anything wrong with the syntax?

Set flag = 'N';

If $(flag) = 'N'

Set  $(vPO) =  $(vPO_C) ;

Set  $(vPSL) =  $(vPSL_C) ;

Set  $(vSHIP) =  $(vSHIP_C);

ELSE

   Set $(vPO) =  $(vPO_H) ;

    Set  $(vPSL) =  $(vPSL_H);

    Set  $(vSHIP) =  $(vSHIP_H);

ENDIF;

Any input would be appreciated

1 Solution

Accepted Solutions
robert_mika
Master III
Master III

Try add Then

If $(flag) = 'N' then

Set  $(vPO) =  $(vPO_C) ;

Set  $(vPSL) =  $(vP......

View solution in original post

2 Replies
robert_mika
Master III
Master III

Try add Then

If $(flag) = 'N' then

Set  $(vPO) =  $(vPO_C) ;

Set  $(vPSL) =  $(vP......

trdandamudi
Master II
Master II

You are missing 'Then' in the syntax.... Below is the syntax of If.... Then.... Else:

if condition then

  [ statements ]

{ elseif condition then

  [ statements ] }

[ else

  [ statements ] ]

end if