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: 
tlucyk
Contributor
Contributor

Sum a column based on the values in another column

Hi Everyone,

I am trying to sum values based on the GL Account for multiple rows. Similar to the below:

 

NameGross AmountGL Account
Joe1000408000
Betty1500408005
Frank12000577209
Louisa5022408000
John4545408008
Cathy5868408004

 

So basically I want to sum the Gross Amount, but only for GL Accounts '408000', '408004', '408005', and '408008'. So I don't want to include '577209'.

So my column should display a total of 17,935.

Could you help me write a function to capture the appropriate data?

 

Labels (1)
1 Solution

Accepted Solutions
tlucyk
Contributor
Contributor
Author

I figured this out. Including the below for anyone else having the same issue:

 

Sum({<GL Account={'408000','408004','408005','408008'}>} num(trim(Gross Amount)))

View solution in original post

1 Reply
tlucyk
Contributor
Contributor
Author

I figured this out. Including the below for anyone else having the same issue:

 

Sum({<GL Account={'408000','408004','408005','408008'}>} num(trim(Gross Amount)))