Why is the code below generating an error? I thought the @iif command only does the calculation if a is not equal to 0...?
I have been inspired by the code in forum post viewtopic.php?f=5&t=10303&p=36003&hilit=splice#p36003. However, many of my "a"-series hold zero values and are thus creating these error messages. what is the best way of overcoming this problem?
Thomas
Code: Select all
wfcreate q 1970 2020
smpl @first 2000
genr b=na
genr a=0
smpl 2000 @last
genr b=2.5
smpl @all
%first=b.@first
%if =%first + " " +%first
genr aux=@iif(a<>0, @mean(b,%if)/@mean(a,%if)*a,b)