Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building a counting object

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi!
Great thing this forum!
I need some help in building up an object.
I would like to build up an object that, inside a report, gives me the count of all those records having the same values in a particular field.
In other words what I want is that, for each record in the report, this object shows me the exact amout of all the records haveing a particular values in a particular field. Is it possible? Could you help me?

Thanks in advance.

Marek.
 
Hello Marek,

What you need is to use some of the fantastic "calculation within a context" that BO offers.

There are several ways to go, this is just one.

Suppose your measure (value) is called &quot;Quantity&quot;. Create a variable &quot;QTY&quot; with the formula =<Quantity>. Create it as a detail. Add the new variable to the table and hide it, or replace Quantity with QTY.
Add a column in the report with the calculation:

=Count(<Quantity>) In <QTY>

that should do the trick.

The In <QTY> part is called extended syntax , chapter 15 from reporter's online guide
 
Hi Blom0344. Thanks a lot. The thing is working! I made a function with your formula.
Do you know if is it possible to make now a control on
=Count()<Quantity>In <QTY> so to show only the report Tat have &quot;(Count()<Quantity>In <QTY> ==1)&quot;???
 
Hello Marek,

For showing only results that meet a criterium you could apply a filter , if you simply want to show only the counts that equal one. However, filters are not directly usuable on report -calculations. So what you could do is assign the formula &quot; =Count(<Quantity>) In <QTY> &quot; to a new variable and apply the filter there.

Now ,suppose you want to show all results , except where count = 1. This is tricky, because when you apply a positive filter you have to select values. However, next time you run a report you could have new values that are not selected.

BO does not have a direct negative filter, so you need a work-around. I usually create a new variable &quot;check&quot; that reads like this :

If (Count(<Quantity>) In <QTY> ) = 1 then TRUE else FALSE.

The value of &quot;check&quot; is then either TRUE or FALSE. On these values you can again apply a positive filter.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top