Skip to main content



      Home
Home » Archived » BIRT » how to count for number of groups ?
how to count for number of groups ? [message #61686] Mon, 25 July 2005 10:53 Go to next message
Eclipse UserFriend
Originally posted by: tomvo.hahaha.be

Hi,

I've got a nice total.count() in some of my reports that tell me how many
detail rows i have.

Now I have the need to count the number of 'groups', but I can't find a way
to do it.


does anyone have a clue ?

Thx,

tom.
Re: how to count for number of groups ? [message #61949 is a reply to message #61686] Tue, 26 July 2005 20:33 Go to previous messageGo to next message
Eclipse UserFriend
Does Total.countDistinct(row["Your grouping column"]) do what you need?

Here is the documentation for this function.

Total.countDistinct
This function computes the number of distinct values within the group or
data set. The expr argument gives an expression used to group the values.
The expression refers to a data row column. Null values are counted as one
distinct value.

Syntax
Total.countDistinct ( expr [, filter [, group ]] )

Arguments
a.. expr
The expression that identifies the unique values. The expression should
reference at least one data row column. See additional description above.
The data type can be number, string or date.
b.. filter
An optional filter condition. See description above.
c.. group
An optional group identifier. See description above.
Returns
The number of distinct values within the group or data set. Returns zero if
no rows were available.

Example
Suppose we want to know the number of different countries represented by a
group of students. We can define a data item that uses the following
expression:

Total.countDistinct( row.Country )
In this statement row.Country is a column that contains the name (or code)
for the student's home country. Suppose that some rows contain null, meaning
that we don't know the home country. We can exclude such rows from our count
with the following statement:

Total.countDistinct( row.Country, row.Country != null )

--
Jane Tatchell
BIRT documentation lead

"Tom Van Overbeke" <tomvo@hahaha.be> wrote in message
news:dc2ud6$hte$1@news.eclipse.org...
> Hi,
>
> I've got a nice total.count() in some of my reports that tell me how many
> detail rows i have.
>
> Now I have the need to count the number of 'groups', but I can't find a
way
> to do it.
>
>
> does anyone have a clue ?
>
> Thx,
>
> tom.
>
>
Re: how to count for number of groups ? [message #62303 is a reply to message #61949] Thu, 28 July 2005 11:05 Go to previous message
Eclipse UserFriend
Originally posted by: tomvo.hahaha.be

Thanks Jane,


Does the job nicely.


gr,
tom

"Jane Tatchell" <jtatchell@actuate.com> wrote in message
news:dc6koa$i80$1@news.eclipse.org...
> Does Total.countDistinct(row["Your grouping column"]) do what you need?
>
> Here is the documentation for this function.
>
> Total.countDistinct
> This function computes the number of distinct values within the group or
> data set. The expr argument gives an expression used to group the values.
> The expression refers to a data row column. Null values are counted as one
> distinct value.
>
> Syntax
> Total.countDistinct ( expr [, filter [, group ]] )
>
> Arguments
> a.. expr
> The expression that identifies the unique values. The expression should
> reference at least one data row column. See additional description above.
> The data type can be number, string or date.
> b.. filter
> An optional filter condition. See description above.
> c.. group
> An optional group identifier. See description above.
> Returns
> The number of distinct values within the group or data set. Returns zero
> if
> no rows were available.
>
> Example
> Suppose we want to know the number of different countries represented by a
> group of students. We can define a data item that uses the following
> expression:
>
> Total.countDistinct( row.Country )
> In this statement row.Country is a column that contains the name (or code)
> for the student's home country. Suppose that some rows contain null,
> meaning
> that we don't know the home country. We can exclude such rows from our
> count
> with the following statement:
>
> Total.countDistinct( row.Country, row.Country != null )
>
> --
> Jane Tatchell
> BIRT documentation lead
>
> "Tom Van Overbeke" <tomvo@hahaha.be> wrote in message
> news:dc2ud6$hte$1@news.eclipse.org...
>> Hi,
>>
>> I've got a nice total.count() in some of my reports that tell me how many
>> detail rows i have.
>>
>> Now I have the need to count the number of 'groups', but I can't find a
> way
>> to do it.
>>
>>
>> does anyone have a clue ?
>>
>> Thx,
>>
>> tom.
>>
>>
>
>
Previous Topic:Any examples or tutorials for integrating scripting?
Next Topic:Image problem
Goto Forum:
  


Current Time: Thu May 08 03:17:43 EDT 2025

Powered by FUDForum. Page generated in 0.44377 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top