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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Sony
Contributor II
Contributor II

How to get the sum of ColumnB values for all the ColumnA values starting with 'AA'

I'm new to QlikSense and I have been struggling to find the solution to my problem. I have 2 columns in my table- ColumnA & ColumnB as shown below

ColumnA | Column B

ABC | 1

AABC | 4

ABBC | 2

ABCC | 2

AABB | 1

I want to get the sum of ColumnB for all the ColumnA values starting with'AA'. The output should be 5.

Please help me!

2 Solutions

Accepted Solutions
henrikalmen
Specialist II
Specialist II

It can be done with set analysis: sum({<[ColumnA]={"AA*"}>} [ColumnB])

Or you could do sum(if(ColumnA like 'AA*', ColumnB, 0))

View solution in original post

ogster1974
Partner - Master II
Partner - Master II

This will work.

ogster1974_0-1677683280382.png

 

View solution in original post

2 Replies
henrikalmen
Specialist II
Specialist II

It can be done with set analysis: sum({<[ColumnA]={"AA*"}>} [ColumnB])

Or you could do sum(if(ColumnA like 'AA*', ColumnB, 0))

ogster1974
Partner - Master II
Partner - Master II

This will work.

ogster1974_0-1677683280382.png