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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading variable in load script

I am writing this expression in the load script to store the value of variable vShare but i am getting error.
let
vShare =avg(aggr(
num(
((sum({$<%EPID={1},Segment={'Stucks'}, TERRITORY=>} (eTRx_Volume))/sum({$<%EPID={7},Segment={'Stucks'},TERRITORY=>} (eTRx_Volume)))-
((sum({$<%EPID={1},Segment={'Stucks'},TERRITORY=>} (eTRx_Volume))-sum({$<%EPID={1},Segment={'Stucks'},TERRITORY=>} (eTRx_Volume_Change))))/
((sum({$<%EPID={7},Segment={'Stucks'},TERRITORY=>} (eTRx_Volume))-sum({$<%EPID={7},Segment={'Stucks'},TERRITORY=>} (eTRx_Volume_Change)))))

,'#,##0.0%'), TERRITORY));
If i write
let
vShare =1; then vShare is storing value 1. but i want to make it dynamic. How can i do it ??
2 Replies
vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi,

You can not create dynamic variable in Load script. You have to define it in variable overview.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Let will attempt to evaluate the expression, rather than store it and this expression will not work in the load script.

Change Let to Set to store the expression in vShare.

And yes, I always load complex expressions variables in this way in the load script as they are not stored in the VC system or in an load without data.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein