Ed Bradley Posted December 2, 2010 Posted December 2, 2010 Thought this would be simple, but I'm stuck. Thanks for your help! I need to give the first number of items, say 2, at no cost. I have that number(2) in a field "no_free". The result should be that the price will be 0.00 for items one and two and the next item, no matter how many more, will be at regular price. What I am trying to do is: free_or_not calculation field is defined as If(the progressive record count w/the same invoice_id ≤ no_free; 0; 1) In the price calculation this field results "free_or_not" is used as a multiplier that keeps or zeros the price. I need to know how to come up with the progressive record count of items sharing the same invoice. Thanks,
comment Posted December 2, 2010 Posted December 2, 2010 I need to give the first number of items, say 2, at no cost. First in what order?
Ed Bradley Posted December 2, 2010 Author Posted December 2, 2010 No particular order, as entered. I am trying to stay away from a script.
comment Posted December 2, 2010 Posted December 2, 2010 Well, "as entered" IS a particular order... : Try defining a self-join of the LineItems table as: LineItems::InvoiceID = LineItems 2::InvoiceID AND LineItems::LineItemID > LineItems 2::LineItemID Then you can use the expression = Count ( LineItems 2::InvoiceID ) + 1 to determine a line item's ordinal number within the invoice. Another option is to leave the line items as they are, and apply a discount that equals the price of the first N items at the invoice level.
Ed Bradley Posted December 2, 2010 Author Posted December 2, 2010 Your right : I give it a shot. Thanks so much for your quick response.
Ed Bradley Posted December 2, 2010 Author Posted December 2, 2010 It worked except the first record did not show its number (1). So I changed the > to ≥ in the relationship and took off the +1 in the field calculation. It works great, again thanks a million! Ed
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now