Skip to main content
Solved

How do I multiply two fields into a custom field ?


darylslinn
Sidekick (Customer)
Forum|alt.badge.img+6

What is the SQL or formula to multiply two fields together in the same view / table as a custom field ?


IFS Apps 10 (EE)

Purchase Receipts History (tbwPurchaseReceiptHistory) Qty Arrived * Price Per Purch Unit/Base
 

 

Best answer by Tomas Ruderfelt

Here is an example, not using the view in the previous post but instead a join:

 

Arguments:

v.order_no,v.line_no,v.release_no,v.receipt_no

 

Select statement:

SELECT r.qty_arrived * (buy_unit_price/price_conv_factor)
FROM purchase_order_line l ,purchase_receipt_info r
WHERE r.order_no = :order_no
AND r.line_no = :line_no
AND r.release_no = :release_no
AND r.receipt_no = :receipt_no
AND l.order_no = r.order_no
AND l.line_no = r.line_no
AND l.release_no = r.release_no

View original
Did this topic help you find an answer to your question?

6 replies

PRODQ
Superhero (Customer)
Forum|alt.badge.img+17
  • Superhero (Customer)
  • 469 replies
  • July 6, 2023

I’m subscribing to this to see how many different answers there will be!  :-) 

In Apps9 I’d do something like this - assuming BUY_UNIT_PRICE and QTY_ARRIVED are fields in the view already

((buy_unit_price)*(qty_arrived))

 

Linda


darylslinn
Sidekick (Customer)
Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • 25 replies
  • July 6, 2023
PRODQ wrote:

I’m subscribing to this to see how many different answers there will be!  :-) 

In Apps9 I’d do something like this - assuming BUY_UNIT_PRICE and QTY_ARRIVED are fields in the view already

((buy_unit_price)*(qty_arrived))

 

Linda

Yes Linda, the fields already exist in the view.


darylslinn
Sidekick (Customer)
Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • 25 replies
  • July 7, 2023

I’ve tried a basic calculation as stated above but that doesn’t work.

Thought anyone ?


Forum|alt.badge.img+7
  • Sidekick (Customer)
  • 15 replies
  • July 7, 2023

Hi @darylslinn ,

Are you able to share your full SQL query?

If in APPS10 - I think the view would be 

PURCHASE_RECEIPT_STAT_UIV

usually when you have created a new custom field the view would be slightly different and the ending would be cfv.

So the view would then become PURCHASE_RECEIPT_STAT_UIV_CFV - you would want to query from this view to access the new field.

This would normally allow you to access the new fields. In my example below the new custom field (TEST) is prefixed with CF$_

If you are able to share your SQL I could take a look.

Kind Regards,

Dan

 


Forum|alt.badge.img+19
  • Superhero (Employee)
  • 488 replies
  • Answer
  • July 7, 2023

Here is an example, not using the view in the previous post but instead a join:

 

Arguments:

v.order_no,v.line_no,v.release_no,v.receipt_no

 

Select statement:

SELECT r.qty_arrived * (buy_unit_price/price_conv_factor)
FROM purchase_order_line l ,purchase_receipt_info r
WHERE r.order_no = :order_no
AND r.line_no = :line_no
AND r.release_no = :release_no
AND r.receipt_no = :receipt_no
AND l.order_no = r.order_no
AND l.line_no = r.line_no
AND l.release_no = r.release_no


darylslinn
Sidekick (Customer)
Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • 25 replies
  • July 10, 2023

Thank you for all your suggestions… the solution that works for us is the one from Tomas.
Your help is very much appreciated. 😀


Did this topic help you find an answer to your question?

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings