Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My goal is to load meta data that has a field with values that I want as variable. Here's the the script snippet. Essentially i do while loop through a table and want to assign the contents of field KPIFormula to a variable that will be named as per the value in ReportingVarName. The issue is that peek is not returning anything (probably return null). THe script runs but there is no value associated with the variable:
1)mytest
2)myvarname and
3)the dynamic variable that I'd like to be set as per the value in ReportingVarName.
For a starter, I'd be happy if i could just get peek working on "mytest" variable. Any help is appreciated. Note that the do while loop is working because the value of RowCnter starts at 0 and ends up at 42 which is the number of rows in the table "KPIData".
KPIData:
LOAD [Used],
[Checked],
[Reporting Name] as KPIName,
[Stat Type] as KPIType,
[Stat Name] as StatisticName,
[Stat Formula] as KPIFormula,
[LS Table Name] as TableName,
[Datamart Table] as DMTableName,
[Datamart Column] as DMColumnName,
[Column Description] as KPIDescription,
KPIFormatValue,
ReportingVarName
FROM
..\KPIData\KPIData.xlsx
(ooxml, embedded labels, table is Sheet1);
Let KPITableRows = NoOfRows('KPIData');
Let RowCnter = 0;
do while RowCnter < KPITableRows
let mytest = peek('[Stat Name]', 5, 'KPIData');
let myvarname = peek('ReportingVarName', $(RowCnter), 'KPIData');
let $(myvarname) = peek('KPIFormula', $(RowCnter), 'KPIData');
let RowCnter=RowCnter + 1;
loop
I figured it out. I use a qualify * statement (and then unqualify attributes as I need them for association) earlier in the script to ensure my data model is correct. That screwed up my peek statement because it expected a fully qualified table.attribute name.
I figured it out. I use a qualify * statement (and then unqualify attributes as I need them for association) earlier in the script to ensure my data model is correct. That screwed up my peek statement because it expected a fully qualified table.attribute name.