0

sum values for a specific data

Hello everyone,

I've tried figuring this out by myself and searching in the forum, but with no luck.

I'm trying to replicate the Excel 'SUM.IF'.

 

I've a table (Table_A) with 2 columns:

-Column A = Product ID

-Column B = Product Cost

 

In antoher table I want to create a formula to sum all the Product Cost for a given Product ID.

So the formula should be something like:

IF (select. Table_A.Product ID) = xyz

then sum(.Product COst)

The result of the formula should be the sum of all the different Product Costs of the product xyz.

 

Hope to have explained it good enough.

 

Thanks in advice

6 replies

null
    • Database Consultant
    • Kirkness_Associates_Ju
    • 5 yrs ago
    • Reported - view

    Hi

    It would basically be this:

    sum((select Product where 'Product Name' = "Mouse Mat").Price)

    If I've understood correctlly that is!

    Julian

    • dealnetshops
    • 5 yrs ago
    • Reported - view

    Thanks, it partialy worked.

    By partially I mean that if the 'product name' is a normal text filed it works great, but when it's a combo box it seems not to recognize the imput.

    So, in your example, when 'Product ID' is a combo box, with 'Mouse Mat' one of 3 options, the result is 0.

    • Database Consultant
    • Kirkness_Associates_Ju
    • 5 yrs ago
    • Reported - view

    Ah - in this case use the number associated with the choice which you can see in admin mode for the combo box

    • Sean
    • 5 yrs ago
    • Reported - view

    I think text('Product ID') will also work 

    • dealnetshops
    • 5 yrs ago
    • Reported - view

    It works, Thanks!! 

    • Igor
    • 5 yrs ago
    • Reported - view

    I have almost the same question but the sum of the Cost field should depend on the time interval (for instance 10.2019)

Content aside

  • 5 yrs agoLast active
  • 6Replies
  • 3504Views