Number of Occurrences - BAQ

Hello,

Does anyone know how/if to do the following in a BAQ?

select 
	ABCCode.CountFreq, 
	COUNT(ABCCode.countfreq) as NumOcurr
from ERP.ABCCode 
group by (ABCCode.CountFreq)

When I try recreating it in a BAQ I can an error;

Severity: Error, Table: , Field: , RowID: , Text: Column ‘Erp.ABCCode.CountFreq’ is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

image

Post Withdrawn - it was not relevant to the quetsion

Not quite the same thing. Trying to count the number of occurrences of the some countfreq. ABCCode is silly example, but I was trying to make it simple.

image

So I have 2 ABCCodes that have 33 as the countfreq.

1 Like

You mean like this?
image

VERY simple:

  1. Display CountFreq field - MARK AS GROUP BY <—This is the magic!
  2. calculated field called NumOccur = Count(ABCCode.ABCCode)
    Here is the resulting BAQ Query phrase:
    image
3 Likes

Thanks @timshuwy! Turns out I had the table set as a Summary table. Which I assumed I needed because I was using an aggregate function.