Home » Developer & Programmer » Forms » How to implement MS Excel's SUMIF function in Oracle Forms (Oracle 10g / Windows XP)
How to implement MS Excel's SUMIF function in Oracle Forms [message #487243] Fri, 24 December 2010 04:49 Go to next message
nikhilk411
Messages: 33
Registered: September 2010
Location: Mumbai
Member
Hi,

I am trying to translate some input data given in MS Excel into Oracle Forms. The Excel sheet consists of usage of the SUMIF() to calculate the values. I am struggling to implement this in Oracle Forms.

I am attaching a screenshot with some sample data set to explain my problem in detail.

/forum/fa/8556/0/

Can anyone kindly guide me how this can be implemented?
Re: How to implement MS Excel's SUMIF function in Oracle Forms [message #487250 is a reply to message #487243] Fri, 24 December 2010 06:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68686
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And what is the definition/feature of SUMIF function?

Regards
Michel
Re: How to implement MS Excel's SUMIF function in Oracle Forms [message #487256 is a reply to message #487250] Fri, 24 December 2010 06:23 Go to previous messageGo to next message
nikhilk411
Messages: 33
Registered: September 2010
Location: Mumbai
Member
Hi Michel,

The SUMIF function works as follows

=SUMIF(range,criteria,sum_range)

As in my sample dataset, --> =SUMIF($A2:$A6,A10,$C2:$C6)
This would SUM all numeric cells in the range C2:C6 where the corresponding row in A2:A6 is equal to, here in my case, A10, i.e "A"

You can refer to http://www.ozgrid.com/Excel/sum-if.htm if my explanation is not precise.

Thanks and Regards,
Nikhil
Re: How to implement MS Excel's SUMIF function in Oracle Forms [message #487259 is a reply to message #487256] Fri, 24 December 2010 06:42 Go to previous messageGo to next message
Michel Cadot
Messages: 68686
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use:

sum(decode(...))
or
sum(case when ... end)

Regards
Michel

Re: How to implement MS Excel's SUMIF function in Oracle Forms [message #487271 is a reply to message #487259] Fri, 24 December 2010 08:51 Go to previous messageGo to next message
nikhilk411
Messages: 33
Registered: September 2010
Location: Mumbai
Member
Thanks Michel, will try this option.

Regards,
Nikhil
Re: How to implement MS Excel's SUMIF function in Oracle Forms [message #487549 is a reply to message #487243] Tue, 28 December 2010 10:55 Go to previous messageGo to next message
nikhilk411
Messages: 33
Registered: September 2010
Location: Mumbai
Member
Hi Michel,

I managed to solve that, didn't use the DECODE(), managed to solve it by using 2 loops and FIRST_RECORD and NEXT_RECORD functions.

Thanks for the help Smile

Regards,
Nikhil
Re: How to implement MS Excel's SUMIF function in Oracle Forms [message #487552 is a reply to message #487549] Tue, 28 December 2010 11:31 Go to previous message
Michel Cadot
Messages: 68686
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Thanks for the feedback.

Regards
Michel
Previous Topic: i need call report from forms 11g
Next Topic: LOV should not repeat values
Goto Forum:
  


Current Time: Thu Sep 19 14:03:56 CDT 2024