Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

Counting Sorted Entries

Discussion in 'Information Technology' started by KB, Jul 28, 2006.

  1. KB

    KB
    Expand Collapse
    Guest

    I have a table with columns "Bid Amount", "Status", and "Type". The status, I
    would sort by awarded in the criteria column. Based on jobs awarded, I want
    to count the number of projects awarded based on dollar amounts and sum it in
    a report.
    Ex.
    Jobs awarded between $1.00 and $15000
    Jobs awarded between $15000 and $30000
    And so on.

    What dollar amount jobs are we most successful bidding based on quantity
    awarded. What type of jobs are we most successful bidding based on quantity
    awarded.
     
  2. Loading...

    Similar Threads Forum Date
    Gurmat Vichaar | Futility Of Counting Paaths | April 12, 2016 Gurmat Vichaar Apr 23, 2016
    Malaysia Malaysian 2013 Election - Vote Counting Underway Breaking News May 5, 2013
    No Counting Allowed in Gurmatt Jap Ji Sahib Dec 15, 2012
    Christianity Ye Olde King James Version, 400 Years and Counting Interfaith Dialogues Mar 27, 2011
    Will counting caste help to reduce inequality? Hard Talk May 11, 2010

  3. Ken Sheridan

    Ken Sheridan
    Expand Collapse
    Guest

    In a footer in a report you can conditionally count rows by using the IIf
    function to return a 1 or 0 if the value falls within a range or not and then
    sum the return values of the function. This in effect counts the rows within
    the range, so the expression for the ControlSource property of a text box for
    the first range would be:

    =Sum(IIf([Bid Amount] < 15000,1,0))

    for the second range:

    =Sum(IIf([Bid Amount] >= 15000 And [Bid Amount] < 30000,1,0))

    Text boxes in a group footer in the report would give you counts for the
    group; text boxes in the report footer would give you counts for the whole
    report.

    You can also use the same technique to conditionally aggregate values in
    other ways, this time by multiplying the amount by the return value of the
    IIf function, e.g. to sum all amounts in a range:

    =Sum([Bid Amount] * IIf([Bid Amount] >= 15000 And [Bid amount] < 30000,1,0))

    or to average the amounts in a range:

    =Avg([Bid Amount] * IIf([Bid Amount] >= 15000 And [Bid amount] < 30000,1,0))

    and so on for whatever other type of aggregation you might want simply by
    using the appropriate aggregation operator.

    Ken Sheridan
    Stafford, England

    "KB" wrote:

    > I have a table with columns "Bid Amount", "Status", and "Type". The status, I
    > would sort by awarded in the criteria column. Based on jobs awarded, I want
    > to count the number of projects awarded based on dollar amounts and sum it in
    > a report.
    > Ex.
    > Jobs awarded between $1.00 and $15000
    > Jobs awarded between $15000 and $30000
    > And so on.
    >
    > What dollar amount jobs are we most successful bidding based on quantity
    > awarded. What type of jobs are we most successful bidding based on quantity
    > awarded.
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page