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: 
Not applicable

Sum() with appymap() in script results in memory leak?

Hi Everybody,

I try to reduce datasize of an existing QVD File by aggregating the data.
I do something like this:

MapData:
MAPPING LOAD FINE_FIELD, MAIN_FIELD;
LoadYears:
LOAD * INLINE [
FINE_FIELD, MAIN_FIELD
E453, A
B554, A
B654, A
G655, B
876, B
];

Data:
LOAD SUM(Amounta) as AmountA,
SUM(AmountB) As AmountB,
OtherData,
anotherData,
applymap ('MapData', FINE_FILED) AS MAIN_FIELD
RESIDENT SrcTable
GROUP BY
OtherData,
anotherData
applymap ('MapData', FINE_FILED);

I do this with large Tables with around 3 Mio Rows. Dispite this takes a long time calculating, it also consumes a lot of memory. (Around 10 times as much as for the non aggregated table). When I tried this aggregation with 27 Mio Records our QV Server reaches memory limits and the script fails.

What is the recomended way for aggregation in QV Script?

1 Reply
hector
Specialist
Specialist

Hi, maybe with this syntax


MapData:
MAPPING LOAD FINE_FIELD, MAIN_FIELD;
LoadYears:
LOAD * INLINE [
FINE_FIELD, MAIN_FIELD
E453, A
B554, A
B654, A
G655, B
876, B
];
Data:
LOAD
OtherData,
anotherData,
MAIN_FIELD,
SUM(Amounta) as AmountA,
SUM(AmountB) As AmountB
GROUP BY
OtherData,
anotherData
MAIN_FIELD;
Load
OtherData,
anotherData,
Amounta,
AmountB,
applymap ('MapData', FINE_FILED) AS MAIN_FIELD
RESIDENT SrcTable;


Test it, and tell me if it's better/faster/worst ior whatever xD

rgds