Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
here is the data:
t1:
load * inline [
name,money
Grant,22
Joey,45
Bob,100
Grant,30
];
let GrantMonty = ????? ====>>>> how to sum Grant's money and put it into variable 'GrantMoney' ?
Hello @grant_S, I think you could use the function SUM in that way: https://help.qlik.com/en-US/sense/May2021/Subsystems/Hub/Content/Sense_Hub/Scripting/AggregationFunc...
It is just an example but then you can apply it to your script:
Temp:
LOAD * inline [
Customer|Product|OrderNumber|UnitSales|CustomerID
Astrida|AA|1|10|1
Astrida|AA|7|18|1
Astrida|BB|4|9|1
Astrida|CC|6|2|1
Betacab|AA|5|4|2
Betacab|BB|2|5|2
Betacab|DD
Canutility|DD|3|8
Canutility|CC
] (delimiter is '|');
Sum:
LOAD Customer, Sum(UnitSales) as MySum Resident Temp Group By Customer;
Hope this helps 🙂
Hello @grant_S, I think you could use the function SUM in that way: https://help.qlik.com/en-US/sense/May2021/Subsystems/Hub/Content/Sense_Hub/Scripting/AggregationFunc...
It is just an example but then you can apply it to your script:
Temp:
LOAD * inline [
Customer|Product|OrderNumber|UnitSales|CustomerID
Astrida|AA|1|10|1
Astrida|AA|7|18|1
Astrida|BB|4|9|1
Astrida|CC|6|2|1
Betacab|AA|5|4|2
Betacab|BB|2|5|2
Betacab|DD
Canutility|DD|3|8
Canutility|CC
] (delimiter is '|');
Sum:
LOAD Customer, Sum(UnitSales) as MySum Resident Temp Group By Customer;
Hope this helps 🙂
@grant_S why would you like to put individual money into individual variable?
just want to have the script short in some special cases.
use load sum it's ok but may take more steps,