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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
mario-sarkis
Creator II
Creator II

Script

Hey all here is my example

ID               trx            Amount 

1211          1                200
1211          1               200

1211         2               300

1211       2                   100

I want my result to be like this

ID             trx           Count(trx)          Sum(Amount)

1211           1                  2                          400

1211           2                  2                          400

Please how can i write this in the script?

Thank you.

2 Replies
Clever_Anjos
Employee
Employee

LOAD

ID          

,  trx

, Count(trx)  as TotalCount

, Sum(Amount) as TotalAmount

resident yourtable

group by ID, trx;


alexandros17
Partner - Champion III
Partner - Champion III

TabA:
LOAD * Inline [
ID , trx, Amount 

1211 , 1 , 200
1211 , 1 , 200

1211 , 2 , 300

1211 , 2 , 100]
;

TabB:
NoConcatenate
LOAD ID, trx, sum(Amount) as Amount, Count(trx) as num Resident TabA Group By ID, trx;
DROP Table TabA;