Home » Developer & Programmer » Reports & Discoverer » URGENT!!! Create a calculation for a condition
URGENT!!! Create a calculation for a condition [message #89180] Fri, 07 November 2003 06:09 Go to next message
Beetle
Messages: 1
Registered: November 2003
Junior Member
I am trying to create a calculation for a condition and I don't know how. I want to say that if a branch is like 'pep' then take the 'sales' amount and multiply only 'sales' amount for that branch by 20% and if a branch is like 'jet' then multiply that branch by 25%. Any help will be greatly appreciated.
Re: URGENT!!! Create a calculation for a condition [message #89187 is a reply to message #89180] Tue, 11 November 2003 05:25 Go to previous message
Michael
Messages: 61
Registered: October 1999
Member
Hello Brett,
I am not sure if I understand your query completely so if my answer is insulting to your discoverer knowledge,I'm sorry.
Firstly I don't know what you mean by Branch.
I would enter a calculation like this :
decode(FIELD_NAME,pep,SALES * 0.2,jet,SALES * 0.25,NULL)
Explanation: The Decode function is explained at http://doug.burns.tripod.com/decode2.html.
This statement compares the entries in the column named Field_name to pep and jet.If the entry is "pep" it returns "sales * 0.2" and if it is "jet" then it returns "sales * 0.25". If the entry has any other value it will return "NULL", alternatively if you want to return sales in all other cases you would enter the field name sales instead of NULL. The simplest way to enter this statement and not misspell any field names is go into the New Calculation screen, select Decode from the list of functions, click on the Items radio button and select the field name you want etc
I hope this is clear,
Michael
Previous Topic: oracle report engine close
Next Topic: unable to edit
Goto Forum:
  


Current Time: Sun May 05 12:36:06 CDT 2024