Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How to apply Sum on dollar values

Received Response
82
Views
5
Comments
Rank 4 - Community Specialist

How to apply Sum on dollar values

i have data as

c1     c2

jan    $10

feb    $20

Both c1 and c2 are varchar datatypes, how can apply sum on c2 which is varchar

since c2 is have $ sysmbol, im not able to cast this to integer

Anyone help

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Rank 4 - Community Specialist

    using Evalauate function, i have removed $ sysmbol. But i have having commas ',' in data ,so that unable to sum valaue. When tried to cast to integer got error.

    Can someone help

  • Rank 2 - Community Beginner

    Why EVALUATE? OBI Gives you a whole catalog of predefind functions which can easily do exactly what you're looking for:

    cast(REPLACE('$1000', '$', '') as DOUBLE)

    Or in your case:

    cast(REPLACE("MyPresentationTable"."MyPresentationColumnWhereIWantThe$SignGone", '$', '') as DOUBLE)

  • Rank 2 - Community Beginner

    Manu, did you let this drop or what's the status of your problem?

  • Rank 4 - Community Specialist

    worked thanks

  • Rank 2 - Community Beginner

    Good to hear. So can you please close this thread by marking the appropriate answers as "Correct" or "Helpful"? This will flag the thread as "Closed" and making it visible to other users that it contains a valid answer to the problem which helps when searching for a resolution in this forum.

Welcome!

It looks like you're new here. Sign in or register to get started.