Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Qlik Community Office Hours: Join us on July 9th, 2025 - REGISTER HERE!
cancel
Showing results for 
Search instead for 
Did you mean: 
MaSo1996
Contributor II
Contributor II

How Variables work in Qlik Sense Script?

Hello fellow Qlik enthusiasts!

I'd like to create variable in Qlik Sense script, that stores value:

 

NoConcatenate
RawTable: //Only with SPG Subproducts
load *,
num([StdCostSemi] / [StdCost],'0,00%') as [% of SPG Cost in Product],
1 as Flag
Resident fplCalcSemiInject;

drop Table fplCalcSemiInject;

NoConcatenate
Sth:
load
Avg([StdCostSemi] / [StdCost]) as [%]
Resident RawTable
Group By Flag;

Let AvgCostOfSPGinProduct = Peek([%]);

I'd expect that variable to give me i.e. 30%, but instead it's blank in sheet:

MaSo1996_2-1740993454060.png

What am I doing wrong? - could you help me with that?

 

 

 

Labels (1)
1 Solution

Accepted Solutions
PrashantSangle

NoConcatenate
RawTable: //Only with SPG Subproducts
load *,
num([StdCostSemi] / [StdCost],'0,00%') as [% of SPG Cost in Product],
1 as Flag
Resident fplCalcSemiInject;

drop Table fplCalcSemiInject;

NoConcatenate
Sth:
load
Avg([StdCostSemi] / [StdCost]) as [%Perc]
Resident RawTable
Group By Flag;

LET AvgCostOfSPGinProduct = Peek('%Perc',0,'Sth');

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

2 Replies
PrashantSangle

NoConcatenate
RawTable: //Only with SPG Subproducts
load *,
num([StdCostSemi] / [StdCost],'0,00%') as [% of SPG Cost in Product],
1 as Flag
Resident fplCalcSemiInject;

drop Table fplCalcSemiInject;

NoConcatenate
Sth:
load
Avg([StdCostSemi] / [StdCost]) as [%Perc]
Resident RawTable
Group By Flag;

LET AvgCostOfSPGinProduct = Peek('%Perc',0,'Sth');

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MaSo1996
Contributor II
Contributor II
Author

Thank You , that worked!