Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
DMG
Contributor III
Contributor III

Counting total occurrences in dataset using existing row field

Hi, imagine i have a data set that looks like this, row data in a table

Audit, Area, Rating

A1, USA, Red
A1, Europe, Red
A1, AMEA, Amber
A2, USA, Amber
A3, USA, Red

In my table i'd like it to show the Audit, and number of ratings, e.g.

Audit, Red, Amber

So in the above data it would be 

A1, 2, 1
A2, 0, 1
A3, 1, 0

What formula would i need to put into the expressions for Red and Amber fields, that counts the total number of red ratings for the audit where the audit is the audit in that row of data.

I.e. to count the total number of "Red" where Audit = <row audit value, e.g. A1, A2, etc>

Hope that makes sense

1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Dimension: Audit

Measure:  Count({<Rating={'Red'}>}Rating)

-Rob