Reputation: 119
I am having a problem trying to do a FOR LOOP as it produces no values.
I am doing 3 steps, but not sure what is the problem, I have attached the APP.
/// 1. These are the FOR values to PASS for the variables below.
for i= -1 to -7 ;
for j=-8 to -15;
for z= -16 to -21
//// 2.These are variable FUNCTIONS with same structure
LET
V_result1=(sum(Peek(Result_1,$i))*0.45+sum(Peek(Result_1,$j))*0.35+sum(Peek(Result_1,$z))*0.2)*1/5;
V_result2=(sum(Peek(Result_2,$i))*0.45+sum(Peek(Result_2,$j))*0.35+sum(Peek(Result_2,$z))*0.2)*1/5;
//// 3. The table where to apply those VARIABLES from a RESIDENT table.
DATE_PRODUCTION_4;
LOAD
"Date",
Sum($(V_result1)) as Forecast1,
sum($(V_result2)) as Forecast2
Resident [DATE_PRODUCTION_3]
GROUP BY "Date";
Upvotes: 0
Views: 1516
Reputation: 364
Couple of things going wrong here:
Argument Description field_name Name of the field for which the return value is required. Input value must be given as a string (for example, quoted literals).
"Input value must be given as a string (for example, quoted literals)."
So instead of:
Peek(Result_1,$i)
You should use:
Peek('Result_1', $i)
When using a variable for text replacement in the script or in an expression, the following syntax is used:
$(variablename)
So building on step one, instead of this
Peek('Result_1', $i)
You should use:
Peek('Result_1', $(i))
Upvotes: 1