Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decode function from Oracle to cognos

Status
Not open for further replies.

mohammedhajat

Programmer
Mar 18, 2009
4
GB
I have a decode sql from oracle, which i need to translate into a measeure into Cognos, it's fairly complex for an amatuer like me..

I know the equivalent is the Case function, but I cant seen to write the case equivalent of the decode, could anyone please assist?


Code:
Code:
 nvl(decode(totalcost,0,null,totalcost),
nvl(decode(submitcost,0,null,submitcost),
nvl(decode(apprvalue,0,null,apprvalue),
nvl(decode(defestvalue,0,null,defestvalue),0)))) as "COST"
 
COALESCE(NULLIF(totalcost,0)
,NULLIF(submitcost,0)
,NULLIF(apprvalue,0)
,NULLIF(defestvalue,0)
,0) "Cost"

niceone,. thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top