Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I load many variables from .xls into QVW . But I can't load the following :
sum({<year={"$(=left(saledate,4)-1)"}>} sales)
after loading , it became : sum({<year={''}>} sales)
if I set it in QVW ,it is ok , How to do it ?
How do you load your variables from .xls? How does your current script look like?
it is like the following :
VariablesTable: |
LOAD VariableName, |
VariableValue |
FROM |
[QVDStore\VariablesTable.QVD] |
(qvd); or xls |
//* Set Equation variables |
//* The following loop allowing for loading numerous variables dynamically, |
//* without having to call them by name. |
for i=0 to noofrows('VariablesTable')-1 |
LET var_name= peek('VariableName',i,'VariablesTable'); |
LET $(var_name) = peek('VariableValue',i,'VariablesTable'); |
TRACE Load Variable: $(var_name) = $($(var_name)); |
next i |
all variables seem ok . but for like this kind of '=..' is not ok .
Let vNumberOfRows = NoOfRows('VariablesTable');
For i = 0 to (vNumberOfRows - 1)
Let vVariable_Name = Peek('VariableName',i,'VariableTable');
Let [$(vVariable_Name)] = Peek('VariableValue',I,'VariableTable');
Next
my script is : for i=0 to noofrows('VariablesTable')-1 LET var_name= peek('VariableName',i,'VariablesTable'); LET $(var_name) = peek('VariableValue',i,'VariablesTable'); // TRACE Load Variable: let $(var_name) =' $($(var_name))'; next i I thinks the problem is '=' in variables ,It seem calcault it before .
How you have stored Varaible Expression / Values in Excel File?
You have to store like
SUM(Value)
Not like
=SUM(Value)
Consider that your expression is something like below...
only( {$<Year={"$(=max(Year))"}>} Year) |
If you Trace this expression during Reload $(=Max(Year)) will be shown as blank as during loading no Year is selected.
May be I am not able to explain the exact technical information....
let $(var_name) =' $($(var_name))---- this is wrong for your kind of expresion, I must use :TRACE Load Variable: $(var_name) = $($(var_name)); it is ok now . I can't explan it also. thanks your help ;
Yes, I also think it's just a problem with your TRACE statement, where the dollar sign expansion in your expression you evaluate in your variable won't work.
So you should have got the correct variables build right from the start, when looking in the variable overview after load, right?
YES ,IT is OK now use trace load .