Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following IF statement:
mod($(vInterpreted_Date_Range), 66) = 0, eLoad_Iterations = (div $(vInterpreted_Date_Range), 66), eLoad_Iterations = ((div($(vInterpreted_Date_Range), 66) + 1));
Is there anything egregiously wrong with this and also, can a statement such as this be in the script?
I guess missing parenthesis would be major issue. One example:
div $(vInterpreted_Date_Range), -> missing one (). Div ( .... ).
Try to share your complete IF statement.
Hi
tresesco is correct. What does the variable contain?
Jonathan
The format of your specification is weird. Everything is wrong with it, especially the missing IF keyword.
There are two types of IF's in QlikView scripting language:
From your question, we cannot make out what sort of IF you're talking about. That's why you should post the complete "statement".
Peter,
The 'IF' part got cut off when I copied and pasted it for some reason.
Below is the complete statement:
IF(mod($(vInterpreted_Date_Range)), 66) = 0, eLoad_Iterations = (div
$(vInterpreted_Date_Range), 66), eLoad_Iterations =
((div($(vInterpreted_Date_Range), 66) + 1)); *
I could see adding the LET statements in front of each eLoadIterations, but
for some reason the script editor does not like the parenthesis right
before ", 66" in the condition part of the statement.
I tried this:
If
(mod($(vInterpreted_Date_Range)), 66) = 0 THEN LET eLoad_Iterations =
(div $(vInterpreted_Date_Range), 66);
ELSE
LET eLoad_Iterations = ((div($(vInterpreted_Date_Range), 66) + 1));
*ENDIF *
*but it still does not like the mod statement (it gives the red squiggly
line under the second parens after vInterpreted_Date_Range in *
(mod($(vInterpreted_Date_Range)), 66) = 0
can I not use an expression for the condition?
Peter,
I actually got it figured out. I changed the IF function to the IF, THEN,
ELSE kind (where those words were typed out) and I had some "Paren-disease"
going on as well. Well, truthfully I just had a parens before a comma that
was causing all the trouble. Thanks!!
Great! The answer is often hidden in the little details ("Argh, those d*mn punctuation marks!"...) Just wait til you start playing with set analysis
Please close the discussion by marking an answer as correct/helpful. That'll make it useful for other community visitors. Thanks.
Peter