

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to evaluate value in variable
I need help getting the output table below from my script.
Load * Inline[Text
text1
text2
text3
Text4
];
Let text1= cadeau;
Let text2= 20;
Let text3= 1;
Let Text4= $(text2)+$(text3);
Table settings
Dimension
Text
Measure
'='&'''$'&'('&Text&')'''
This is not returning the values on the table. How to display the values on the measure column?
Thanks
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI
Try like below
Let text1= 'cadeau';
Let text2= 20;
Let text3= 1;
Let Text4= $(text2)+$(text3);
Load *, evaluate(Text) as M Inline [
Text
text1
text2
text3
Text4
];
O/p:
Please close the thread by marking correct answer & give likes if you like the post.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI
Try like below
Let text1= 'cadeau';
Let text2= 20;
Let text3= 1;
Let Text4= $(text2)+$(text3);
Load *, evaluate(Text) as M Inline [
Text
text1
text2
text3
Text4
];
O/p:
Please close the thread by marking correct answer & give likes if you like the post.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your suggestion worked when I tried but when I applied to the actual data it didn't quite work. the different is that I am actually Auto generating the variables from a qvd. Please see the actual code below.
This worked:
Let text1= 'cadeau';
Let text2= 20;
Let text3= 2;
Let Text4= ($(text2)+$(text3))*$(text3);
Let Text5= '$(text2)';
Let Text6= If('$(text1)'='cadeau',$(text3),100);
Load *, evaluate(Text) as M Inline [
Text
text1
text2
text3
Text4
Text5
Text6
];
CODE NOT WORKING
Sub LoadVariables
Variables:
LOAD
"Text",
M
FROM [lib://DataFiles/VarData.qvd]
(qvd);
LET Table =;
//Let Variables
CALL Qvc.PopulateVariables('Variables');
DROP Table Variables;
ENDSUB
SUB Qvc.Populatevariables(vVarTableName)
For i=0 to NoOfRows(vVarTableName)
Let vVarFieldName = FieldName(1, '$(vVarTableName)');
Let vVarValueFieldName = FieldName(2, '$(vVarTableName)');
Let vVariableName = Peek('$(vVarFieldName)', $(i), '$(vVarTableName)');
Let $(vVariableName) = Peek('$(vVarValueFieldName)', $(i), '$(vVarTableName)');
Next
End SUB
Call LoadVariables;
Load *, evaluate(Text) as M Inline [
Text
text1
text2
text3
Text4
Text5
Text6
];
Output

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ericdelaqua
Might be, its due to field name is in Capitalize , but variable is in lower cast
Can you try with lower case and verify it
Please close the thread by marking correct answer & give likes if you like the post.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes that was part of the issue but the variable are still not fully evaluating, I think it is just evaluating the Text values.
Pleasee see below.
really appreciate your assistance.
thanks


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok I have changed the query to this and it is working except for TEXT.
Load *, Evaluate(evaluate(Text)) as M Inline [
Text
text1
text2
text3
text4
text5
text6
];
