
Contributor III
2021-12-01
12:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
qlik data load editor
Hi All,
I need to calculate average of the column in the data load editor script and store it in a variable.
products table looks like this :
I need to calculate the avg(col d). I tried the below line but, avgPRC is blank.
LOAD avg([Count]) as avgPRC resident [PRODUCTS];
1,006 Views
1 Solution
Accepted Solutions

Specialist II
2021-12-03
05:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This work:
InlineData:
Load * inline [
Col A, Col b, Col C, Col d
A1,Cc1,Type a,18
A2,Cc2,Type b,21
A3,Cc1,Type c,89
];
AvgCold:
Load
Avg([Col d]) as [Avg Col d]
Resident InlineData;
let vAvgCold=peek('Avg Col d',0,'AvgCold');
Drop Table AvgCold;
And the variable is populated:
Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
If a post helps to resolve your issue, please accept it as a Solution.
2 Replies

Specialist II
2021-12-03
05:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This work:
InlineData:
Load * inline [
Col A, Col b, Col C, Col d
A1,Cc1,Type a,18
A2,Cc2,Type b,21
A3,Cc1,Type c,89
];
AvgCold:
Load
Avg([Col d]) as [Avg Col d]
Resident InlineData;
let vAvgCold=peek('Avg Col d',0,'AvgCold');
Drop Table AvgCold;
And the variable is populated:
Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
If a post helps to resolve your issue, please accept it as a Solution.

Contributor III
2021-12-06
12:01 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Micheledenardi,
Thanks for your suggestion. It worked
PRE
Do not input private or sensitive data. View
Qlik Privacy & Cookie Policy.
