Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
sibrulotte
Contributor III

Loading variables from excel

Hi,

the first part of my script works, but I want to load another set of variables from another tsheet, and that script doesn't work.

LOAD [Réf.calcul règle] as R_Réf_Calcul_Règle,
    
[Nom référence] as R_Nom_Réf_Calcul_Règle,
    
Champ,
    
Comparatif,
    
[Valeur référence],
    
Nom_variable_QV,
    
Clause_Variable_QV
FROM
some file.xlsx
(
ooxml, embedded labels, header is 0 lines, table is REGLES_QV);


for i = 0 to NoOfRows('Référentiel_Calcul_Règles') - 1
  let vName = peek('Nom_variable_QV', i, 'Référentiel_Calcul_Règles');
  let $(vName) = peek('Clause_Variable_QV', i, 'Référentiel_Calcul_Règles');
next i
let vName = null();


Référentiel_Règles:
LOAD [Réf.calcul règle] as [Réf.calcul règleA],
    
Description_regle,
    
[Description du contrôle],
     
Nom_variable_regle  
FROM
same file.xls
(
ooxml, embedded labels, table is Regles);

for Vi = 0 to NoOfRows('Référentiel_Règles') - 1
  let vName1 = peek('Nom_variable_regle', Vi, 'Référentiel_Règles');
  let $(vName1) = peek('Description_regle', Vi, 'Référentiel_Règles');
next Vi
let vName1 = null();

The error is :

Script line error:

let vR-PGAF-0001 = peek('Description_regle', Vi, 'Référentiel_Règles')

So this occurs in the second Let once the variable name has already been retrieved, and I'm trying to define it...

Any help is appreciated

1 Reply
felipe_dutra
Contributor

Re: Loading variables from excel

Hi,

Have you tried that?

let '$(vName1)' = peek('Description_regle', Vi, 'Référentiel_Règles');


Felipe

Community Browser