Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Progressive count of records sharing the same invoice_id

Featured Replies

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,

I need to give the first number of items, say 2, at no cost.

First in what order?

  • Author

No particular order, as entered. I am trying to stay away from a script.

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.

  • Author

Your right : I give it a shot. Thanks so much for your quick response.

  • Author

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

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.