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

Hi please help if its possible,

my case is that i have a table similar to this example

ID               Date             Amount 
1                 2013            5000

1                 2013            4000

2                2013             3000

2                2013              2500

1                2014               200

1                2014              350

2                2014              2000

2               2014               200

how can  i write in the script  to get this OUTPUT

ID                Date             Amount        Count

1                  2013           9000              2

2                  2013           5500              2

1                  2014           550                 2

2                  2014          2200                2

Hope you can help .

2 Solutions

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

add to your script:

load

ID,

Date,

sum(Amount) as Amount,

count(ID) as Count

resident your datatable

group by ID, Date

;

drop table your datatable;

Regards

View solution in original post

jonathandienst
Partner - Champion III
Partner - Champion III

I am not sure why you want to do this in script, but here goes:

LOAD ID,

     Date,

     Sum(Amount) As Amount,

     Count(Amount) As Count

FROM .....

GROUP BY ID, Date;

(Replace FROM with RESIDENT if applicable)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

4 Replies
martinpohl
Partner - Master
Partner - Master

add to your script:

load

ID,

Date,

sum(Amount) as Amount,

count(ID) as Count

resident your datatable

group by ID, Date

;

drop table your datatable;

Regards

jonathandienst
Partner - Champion III
Partner - Champion III

I am not sure why you want to do this in script, but here goes:

LOAD ID,

     Date,

     Sum(Amount) As Amount,

     Count(Amount) As Count

FROM .....

GROUP BY ID, Date;

(Replace FROM with RESIDENT if applicable)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
alexandros17
Partner - Champion III
Partner - Champion III

AAA:
LOAD * Inline [
ID, Date, Amount 
1 , 2013, 5000
1, 2013 , 4000
2, 2013 , 3000
2, 2013 , 2500
1, 2014 , 200
1, 2014 , 350
2, 2014 , 2000
2, 2014 , 200
]
;

LOAD Sum(Amount) as Amount, ID, Date, Count(ID) as Counts Resident AAA Group By ID, Date;
DROP Table AAA;

Anonymous
Not applicable

load * inline [

ID, Date,Amount 

1,2013,5000

1,2013,4000

2,2013,3000

2,2013,2500

1,2014,200

1,2014,350

2,2014,2000

2,2014,200

]
;



load

ID,

Date,

sum(Amount) as amt,

count(ID) as cnt

Resident temp

Group by ID,Date;