Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Lacinne
Partner - Contributor
Partner - Contributor

Set variable from Load statement of excel document

Hi.  I have this section of code

[Inbound]:
LOAD
INVOICENO,
TRANSDATE,
TRANSTYPEID,
WHSCODE,
left(SENDER,6) as 'CUSTID',
CHARGETYPE,
CHARGEDESC,
CHARGEQTY,
"RATE",
CHARGE
FROM [lib://MyPath/*.xlsx]
(ooxml, embedded labels, table is Inbound);

 

I need to set variable vCustID = Inbound.CustID

 

Is this possible?

Labels (4)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

As below

 

 

[Inbound]:
LOAD
INVOICENO,
TRANSDATE,
TRANSTYPEID,
WHSCODE,
left(SENDER,6) as 'CUSTID',
CHARGETYPE,
CHARGEDESC,
CHARGEQTY,
"RATE",
CHARGE
FROM [lib://MyPath/*.xlsx]
(ooxml, embedded labels, table is Inbound);

 

set variable vCustID = peek( 'CustID',0,'Inbound');

Here 0 indicates value from the first row will be assigned to the variable

read more below

https://help.qlik.com/en-US/sense/May2022/Subsystems/Hub/Content/Sense_Hub/Scripting/InterRecordFunc...

 

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
MatheusC
Specialist II
Specialist II

 
 
Hello @Lacinne

To create a variable in the script, you will insert the function:

let vCustID = Inbound.CustID;



If it helped, mark it as a solution and leave a Like

Thank you so much!
Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
vinieme12
Champion III
Champion III

As below

 

 

[Inbound]:
LOAD
INVOICENO,
TRANSDATE,
TRANSTYPEID,
WHSCODE,
left(SENDER,6) as 'CUSTID',
CHARGETYPE,
CHARGEDESC,
CHARGEQTY,
"RATE",
CHARGE
FROM [lib://MyPath/*.xlsx]
(ooxml, embedded labels, table is Inbound);

 

set variable vCustID = peek( 'CustID',0,'Inbound');

Here 0 indicates value from the first row will be assigned to the variable

read more below

https://help.qlik.com/en-US/sense/May2022/Subsystems/Hub/Content/Sense_Hub/Scripting/InterRecordFunc...

 

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.