Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have the following scenario,......
YearRange:
Load Max(Year) as MaxYear, Min(Year) as MinYear resident Table1;
Let vMaxYear= Peek('MaxYear',0,'YearRange');
Let vMinYear= Peek('MinYear',0,'YearRange');
Set vRangeMax=$(vMaxYear);
Set vRangeMin=$(vMinYear);
Drop Table YearRange;
Do
Load
$(vRangeMax) as Year
Resident Table1
where Year=$(vRangeMax)-1;
Set vRangeMax= Num($(vRangeMax))-1;
LOOP while $(vRangeMax) >$(vRangeMin);
Store Table1 into 'D:\Table1.qvd';
Note : " $(vRangeMax) " is showing an error......
How we can load table...
Thanks
Madhu
The problem is due to the $ expansion in the Set command returning a null. Although a Set command expression is not evaluated, the $ expansion happens before the Set statement. What you need to do is to defer the $ expansions. You can do this;
Let vRangeMax = '$' & '(vMaxYear)';
This prevents the $ expansion from happening in the script.
I often do this instead:
Set vRangeMax = #(vMaxYear);
Let vRangeMax = Replace(vRangeMax, '#', '$');
This is useful for complex expressions which are awkward with the single step process - although for simple ones i would use the first suggestion.
Hi Jonathan
Thanks Your reply...
Where i want to use & Where i want to declare variables.
Thanks
Madhu
Hi Jonathan
-> Once we debug the script ...
Output :
Syntax error, missing/misplaced FROM:
Load
as Year,..........
madhu babu wrote:
Where i want to use & Where i want to declare variables.
I don't understand the question
madhu babu wrote:
-> Once we debug the script ...
Output :
Syntax error, missing/misplaced FROM:
Load
as Year,..........
You are probably missing a semi-colon or comma somewhere
Hi Jonathan
After Load
"$(vRangeMax)" does not recognize
change Set vRangeMax= Num($(vRangeMax))-1;
to let vRangeMax= Num($(vRangeMax))-1;
Something is wrong with your (updated) script, but without seeing it, I cannot help you.
madhu babu wrote:
After Load
"$(vRangeMax)" does not recognize