Jump 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.

Conditional Sum with multiple tests

Featured Replies

  • Newbies

Hi all,

I have a problem I can't seem to solve on my own.

I have products in my database that each have 1 of 3 different taxtypes (TAX_A (high tax), TAX_B(low tax), TAX_C(no tax)) and 1 of 3 different producttypes (RENTAL, BUY, PACKAGING)

Now on my invoice I want the following TAXES to be displayed.

RENTAL (=products that are TAX_A and RENTAL)

BUY HIGH (=products that are TAX_A and BUY but not Items::IT_Type= "Drinks 19%" or Items::IT_Type= "Drinks 6%"))

BUY LOW (=products that are TAX_B and BUY but not Items::IT_Type= "Drinks 19%" or Items::IT_Type= "Drinks 6%")

DRINKS HIGH (=products that are TAX_A and Items::IT_Type= "Drinks 19%")

DRINKS LOW (=products that are TAX_B and Items::IT_Type= "Drinks 6%"))

PACKAGING (=products that are TAX_C and PACKAGING)

So I have to make a some sums but only from the prices of the products that have those 2 conditions...

I hope you guys know what I mean...

You may want to try CASE, this should do what you are looking for.

case(

producttype = "Rental" and taxtype = tax_a; formula1;

(producttype = "Buyl" and taxtype = tax_a) and not (Items::IT_Type = "Drinks 19%" or Items::IT_Type = "Drinks 6%" ; formula2;

etc....

)

  • Author
  • Newbies

Thanks for your reply.

Still can't figure out how to display the tax. I got this:

On the invoice I got a field:

<<Bestellingnummer naar BesteldJoin::FACT_BTW_HUUR>

In the database I got a field in the "orders" table called "FACT_BTW_HUUR" with:

Case(

Items::IT_KoopHuur = "HUUR" and Items::IT_BTWType ="A"; FACT_Bruto_BTWA)

It's dutch..."HUUR" is dutch for "RENTAL"

FACT_Bruto_BTWA has this function:

Sum(Besteld BestNr naar Orders::IT_metBTW_A) + FACT_Bezorgkosten + FACT_BreukTotaalInclBTW

Anyone able to help?

thanks

Create an account or sign in to comment

Important Information

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

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.