Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sibrulotte
Creator III
Creator 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
Partner - Creator
Partner - Creator

Hi,

Have you tried that?

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


Felipe