Limiting the data to 2 decimals

my input may be
Input -> 1234.678988777  output should be -> 1234.67
input -> 10.3243253554    Output should be -> 10.32
Input -> 0.000000234        output should be -> 0.00
If I use formatNum it is appending 000 on the left. I dont need that.
How do i achieve this?
If I have to write UDF plz provide me with the code.
Thanks,
Venkat.

Hi venkat,
     Can you write the UDF as follows,
Create one UDF with variable name 'a'
Imports   
java.text.DecimalFormat;
double  d = Double.parseDouble(a);
       DecimalFormat Currency = new DecimalFormat("#0.00");
       a= Currency.format(d);
return a;
This is a efficient code because using only standard library function.  Jose also gave the correct code, But he was using lot of IF conditions. So, system will take time.
Regards
Vijaykumar.S

Similar Messages

  • Limiting the data Iu0092m uploading

    Hi,
    I’m uploading data to one of the infocube I have. And I would like to upload data only for the past 4 months. I don’t want all the data from 2006, only from Oct, Nov, Dec and Jan 07. How can I do this? Is there an option in the infocube to limit the dates of the extractions?
    Thanks a lot
    Regards
    Vic

    Hi,
    Go to your infopackage, and in the first tab set the right months in the selection.
    If for some reason you don't see month in the list of fields that you can restirct, you will need to make the infoobect 0calmonth (or other you are using) selectable in your datasource.
    Hope it helps,
    Gili

  • Final user's can not see the data due to limited authorization.

    We have created a InfoSet with three info Objects, 0Account, 0Costcenter and 0COMP_CODE. 0Costcenter have an attribute retail location  0RT_LOCATIO.
    0RT_LOCATIO is an authorization relevant object. We as consultants can execute the infoset properly, but final user's with limited authorizations can not see the data because of authorization failier
    We hae several options to solve the issue, deleselect the auth. flag in the infoobject; delete the infoobject from the attributes of the cost center or create an authorization object and assign it to the final user's profile. But we don't want to go that way.
    My question is, is there any way to avoid including this attribute in the infoset definition? We are not using it in the query and we don't need it, so if we could delete it from the infoset (in the same way you add or delete infoobjects from an Infocube) without changing the cost center aster data, we will have our problem solved.
    Does anyone how to do this (if possible)?
    Thanks in advance!

    Just do two things to find the authorization check failed for that user.
    1. Execute SU53 output and find out the authoirzation check failed. If yes, please send that to BASIS Team.
    2. Next one, switch on the authorization trace in ST01 and ask that user to see that data. if the user is failed with authorization issue. switch off the trace in ST01 and find out the issue.
    Do this way, if it is not successful you can go for any other alternate way.
    Hope this would help you.

  • Custom Line Manager Data Role is limiting the Line Manager Actions

    Hi
    I have Created Custom Data Role on Seeded Line manager role and it is limiting the Line Manager actions (I see only Promotion and Manage Directs actions)
    since i cant create a New data Role on Line Manager Abstract role. I followed these steps to do the same:
    1. I have Created the 'SPS Plant Rep New' job role which inheritance the seeded 'Line Manager (HCM)'
    2. i have Create the 'SPS Tulsa Plant Rep' data role with custom person Criteria (Include some locations and Exclude some Department)
    3. i have assigned the 'SPS Tulsa Plant Rep' data role with person
    4. ran the Retrieve process
    5. Login as person who has the 'SPS Tulsa Plant Rep' data role and pick employee who meets the criteria and click on Actions, we are seeing only Promote and Manage Directs actions
    but seed line Manager will have all actions like transfer, terminate, Change location, change manager.. ets but i am not seeing any of them.
    my Custom Data role Suppose to restrict only people search not actions.
    please refer the doc for all screenshots.
    Thanks
    Kranthi

    Is this "On Site" or on Cloud ? The actions that you mention are they secured by function security  (that is with OPSS permissions) or data security restricting access on the actions on specific data ? If this is data security and you have access to the database you potentially use the Data Security PLSQL APIs to triage what the issue is.
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

  • Saving the data into the tab limited text file

    Dear Friends ,
    please help me at the earliest possible , i want to store the data into an text file which is tab limited ,previously i was able to the same into the excel sheet using the jakarta HSSF POI , an open source library to store the data into the EXCEL sheet , now friends please tell me whether is there any other open source to store the data into the tab limited text file what i mean by tablimited is the data is to be saved as
    Name        Email-id        phone          streeet          city
    sri            @some.com     9434           jahdui          hye
    asdf         @.com           3455           sdgsdf         retlike this so please suggest me
    thank you in advance,
    bye
    sriharsha

    Consult the docs for BufferedWriter and from there.
    regards
    Christian
    import java.io.*;
    public class Test
         public static void main(String[] args)
              BufferedWriter writer;
              String[][] s = { {"Name","Email-id","phone","streeet","city"},
                        {"sri","@some.com","9434","jahdui","hye"},
                        {"asdf","@.com","3455","sdgsdf","ret"}};
              try {
                   writer = new BufferedWriter(new FileWriter("out.txt"));
                   for (int j=0; j< s.length; j++) {
                        for (int i = 0; i < s[j].length; ++i) {
                             writer.write(s[j]+"\t");
                        writer.newLine();
                   writer.close();
              } catch (IOException e) {
                   e.printStackTrace();

  • Issue with the Data Type 'Number' in Business Objects

    Hi,
    I have an Object in the Universe where the Data Type of the Object is a number. This Column pertaining to this Object has certain values in the database out of which there is a 17 Digit Value which is 00000000031101165.
    Now, when trying to retreive the same value through Business Objects it is getting rounded off to 00000000031101200 automatically when trying to view in Webi and when trying to retreive the same in Designer/Deski, it displays as 0.000000003110116E+16.
    So, I would like to know if there is any other alternative in trying to retreive the Original Value that would not round off. Also, do we have any Limitation for the Data Type Number in Business Objects? The Version we are on is XI3.1.
    Note: There are no functions that are used on this Object at the Universe Level and would not like to use any functions here.

    What is the underlying database?
    It looks like the data is considered to have two decimals, but is rounded to zero decimals.
    Only you don't see the number formatting.
    Is this a BW query?
    Is this a calculated keyfigure?
    In the query you can specify the rounding you want and it is also possible to specify it on an infoobject level.
    Check those settings...
    Hope this helps,
    Marianne
    PS. Oh, and about the formatting, you can specify a default object format in the universe and override it on the final client (WebI, Crystal)

  • Refreshing the Data Source View in Analysis Services

    I have added columns to the SQL Database table that is used as a dimension in an Analysis Services Cube.  The new columns will be used as additional Property Fields for the dimension.  When I attempted to refresh the Data Source view so that the additional columns are present, I am given the following error:
    System.Data
    Property not accessible because 'Parent Columns and Child Columns don't have type-matching columns'
    I have done nothing to the columns used for the parent of child and the error message provides nothing to gon on. Does anyone have any ideas on this?
    Gary

    Olga,
    Thanks for your response.  I will try and answer your questions
    1) I have not tried removing the columns yet.  I will try that this afternoon but have limited hope.  The two columns I added are simple text columns that will be used as attributes in the dimension.  I have made no change to the parent or child columns.
    2) The table I modified is the source table for a parent-child dimension.
    3) The reference to the "check list" does not take me to any kind of check list.
    4) The parent-child dimensions I am trying to modify have been in use for months and the parent and child columns do have the dame data types.
    5) I have also check the data types between the dimension table and the fact table.  they use the same data types (small int).
    6) I have not made a collection for the parent key, it is a single column. The remainder of your last paragraph is not clear to me. Can you give me an example.
    I am fairly inexperienced with Analysis Services, please talk slow and use small words  :-)
    Thanks again for your help!
    Gary

  • Cannot display the data from a varaible in front end

    hi,
    i not able to display the data in the table from the variable.
    steps how the module should work.
    In OEO:
    1. data to be accepted from user, values to be passed to the program in database according to the data accepted.
    In Oracle Express:
    2. values is accepted in database program as arguments. according to arguments the limits are applied and calculation is made for leaf level and then assigned to variable
    3. rollup is called in database program.
    In OEO:
    4. the data is shown in tables here the user can limit his view of the data according to his needs.
    my problem:
    the data acceptence from oeo is working fine and the backend or the database part(program, rolllups etc) are working fine. when values are passed thru express command box the program is working fine.
    i am not able to get the calculated data form the variable which stores it and display in the table. the database connectivity is fine.
    note: the display of data in table is in other page not in the data acceptence page.
    pls also let me know how to check in oracle administrator whether the values sent from oeo and accepted in backend properly.
    i will be thankfull if any helps me out to solve this problem.
    naveen

    hi,
    i not able to display the data in the table from the variable.
    steps how the module should work.
    In OEO:
    1. data to be accepted from user, values to be passed to the program in database according to the data accepted.
    In Oracle Express:
    2. values is accepted in database program as arguments. according to arguments the limits are applied and calculation is made for leaf level and then assigned to variable
    3. rollup is called in database program.
    In OEO:
    4. the data is shown in tables here the user can limit his view of the data according to his needs.
    my problem:
    the data acceptence from oeo is working fine and the backend or the database part(program, rolllups etc) are working fine. when values are passed thru express command box the program is working fine.
    i am not able to get the calculated data form the variable which stores it and display in the table. the database connectivity is fine.
    note: the display of data in table is in other page not in the data acceptence page.
    pls also let me know how to check in oracle administrator whether the values sent from oeo and accepted in backend properly.
    i will be thankfull if any helps me out to solve this problem.
    naveen

  • How can i access a mysql table without putting the data in a datagrid

    I developed my air app with a datagrid which uses a php service to display all data from a table of strings in MySql.
    I now do not need the datagrid, how can i get the data from my database without putting it into a dataGrid? Do i need an array? how do i do this? anyone got any example code?

    Balakrishnan V wrote:
    var resultArrayCollection:ArrayCollection=new ArrayCollection()
    protected function resultHandler(event:ResultEvent)
         result=event.result as ArrayCollection
    You can use the result array collection now inside your program for any further changes / manipulations.
    Hope this helps; If you have further doubts, do ask...
    Balakrishnan V
    Hi, yeah this helps,
    however, how would i generate a result handler for a service that has not been called yet? Sorry my knowledge of services is very limited.
    This is a php service, get_all service that returns all the rows from a mysql table.
    I can see the service box with the service i want to use:
    but how do i pass that to a result handler?

  • Limitation on data passed to Crystal Report

    Hello, I have a very basic question that I cannot find the answer to in the manual or online.
    We are pulling data from a SQL 2005 database.  Specifically, we are querying information that contains very complicated legal instructions - the equivalent of two dozen pages of text.
    We are finding that the data is being truncated once it reaches the report to about 7 pages....
    Is there a limit on the amount of data Crystal Report XI can bring across from a single record. Or is this a limitation of the report itself? I am working with the developers who are struggling to make this work correctly and I am trying to get to the bottom off this.
    Thanks for your time!
    Dirk

    I believe there is a limit to the length of string Crystal can work with, although I can't remember what it is off the top of my head, but probably 65534 characters - once upon a time it was 256 characters!
    You could try working around this limitation by creating a few formulas, grabbing, say, the nth 1000 characters and storing it into a variable.
    eg:
    stringvar part1:=left(YourField, 1000);
    stringvar part2:=mid(YourField, 1001, 2000);
    stringvar part3:=mid(YourField, 2001, 3000);
    etc...
    Of course, you could wrap that up in a loop to automate it if you'd prefer.
    Then, create a formula for each of the above "part(x)" variable to display the contents:
    //Formula @show_part1
    stringvar part1
    //Formula @show_part2
    stringvar part2
    etc...
    Finally, drop each of these "show" formulas into a single textbox and hopefully, you should get what you need.
    If not, chop it up in the SQL command/view/whatnot and return it as seperate columns and concat them in a similar textbox fashion?
    Let us know how you get on...
    Ta,
    J

  • The "infallible" backup system crashes and burns; how to transfer the data?

    After five years of exemplary, error-free service, my old Powerbook G4 1Ghz finally crashed during a backup to an external hard drive. I just bought a new Macbook Pro (arrived September 16th) and want to transfer the data from the old Pro to the new Pro. Herein lies the complex problem, and Migration Assistant and a firewire cable won't solve it.
    When the old Pro died, I was maintaining what I believed to be an infallible backup system (ha). I did nightly backups to two different external hard drives; one was a USB LACIE drive, the other a firewire LACIE drive. I used Carbon Copy Cloner to do a merge contents backup on the USB drive and a file-level bootable clone to the firewire drive. Surely nothing could go wrong. Oh, one only needs to think of the Titanic and say, “Something did.”
    The old Pro could only backup to the USB drive when using an express card that added USB 2.0 connections (the old Pros have USB 1.1 and they’re too slow). But whenever the express card was plugged into my old Pro and it fell asleep without my first powering the card off, the computer crashed. This was no problem; I just powered off the card before putting it to sleep and ignored the fact that the computer on rare occasion acted buggy with the USB express card plugged in. Well, on the fateful night in question, the computer did its backup to the USB drive and then fell asleep while it was still plugged in (this is what its energy saver told it to do, unfortunately). When I tried to turn the computer back on, a black box appeared in the upper left hand corner with a bunch of random-seeming white text and the concluding message, “Waiting for remote debugger.” The computer was frozen and a cold reboot was the only option.
    My old Pro would never be the same again.
    I tried to boot it up. Sometimes it did so, but then would suddenly show a red screen and crash. It kept crashing, sometimes just powering off immediately. So I brought out good old Disk Warrior, booted up with that, repaired permissions, repaired disk, and rebuilt the directory. I also booted up with the Tiger OS X install CD and fixed permissions that way just for good measure. The computer then started up fine. I thought I was back to normal! Celebration time! Not. The USB drive that I had backed up to would not mount anymore. So I, seeing that the computer appeared to be back to normal, just plugged in second external hard drive--the firewire--and began the bootable clone. It delved into making the clone without a hitch and I went off to work happy and content that I would have an up-to-date backup soon.
    Lo and behold, when I came back from work, the backup to the firewire drive hung midway through. It had done nothing but wiped the entire drive and copied about 500 mb of data to it before freezing. I tried again several times and, believe it or not, only got vastly improved results when the offending express card was actually plugged into the computer. By this mysterious and probably risky method, I was able to get some data off. But only about 1/10 of the whole. The old Pro always would crash before more than 5 gigs of data or so can be transferred.
    Starting from around that time, the offending old Pro began to exhibit hideous popping, gurgling, grating, clicking, swiping, and other sounds from the left hand side of the computer—where I imagine the hard drive is. These sounds can be quite loud and sometimes even sound like tempered UFO tones beamed down to the computer. Sometimes they aren’t present at all and the computer acts fine, until a certain file or folder is accessed, and then they start again and the computer hangs, going from fine to disastrous in an instant.
    I took out the offending express card and launched it away and took the USB drive and put it on another computer. It still would not mount. I finally got it to unlock (it’s a fingerprint-access safe drive) and ran Disk Warrior on it and was able to get as much data off it as I could. But it appears that a huge chunk of data was simply missing from the drive, whether from Disk Warrior having to delete data when it rebuilt the directory or from damage when the computer died while backing up to this drive, I don’t know.
    So now I went from a supposedly infallible backup system of two rotating external hard drives to potentially losing 5 years of utterly critical work!
    I tried starting up the old Pro in target disk mode with my new Pro. At first, this appeared to have very promising results because there was no grating or popping sounds from my old Pro when I did this. I began a data transfer with glee. But no luck; the old Pro always eventually hangs and the new Pro doesn’t even recognize it (the icon for the old Pro disappears as if I unmounted it).
    Sometimes the Old Pro can still boot up and seem to act fine; it can sit like that indefinitely, I'd guess; but if the disk is actually read and written to enough, it always fails. I am using it as little as possible now (i.e. not at all) so as not to exacerbate the problem any more than it already has been.
    Two quick notes that might further explain the situation: two weeks before the crash happened, I used iDefrag to defragment the drive. The night before the crash happened, I did a lot of work on my computer while on a bumpy trip on the Long Island Railroad. The computer acted fine throughout all this, but perhaps the bumpiness or the defragmentation contributed to this problem.
    I must get the data off. This dead/dying hard drive doesn’t just contain mere photos and music libraries and nifty applications. I’m talking completed and incomplete novel manuscripts, lecture notes, lesson plans, published and to-be-published articles, a massive thesis, and much more totaling literally thousands upon thousands of pages and representing more than 5 years of graduate and professional research and work. For me, the stakes are critically high. Thank you for reading this Hero's Journey of a post.

    Good news!
    Imagine a Venn diagram with four interlapping circles. The circles are:
    1. Catastrophically exploded hard drive
    2. Catastrophically annihilated external hard drive used for incremental backups
    3. Catastrophically wiped cleaned external hard drive used for bootable clones
    4. Email, CD, and iPod backups
    With a little shake, rattle and roll and other craziness you do with a hard drive with failed bearings, I got #1 working briefly, thank goodness.
    With Disk Warrior and figuring out how to surpass a fingerprint-activated security feature, I got #2 working in a limited fashion.
    With some workarounds, I got some use out of #3.
    #4 just is.
    The interlap of these 4 things produced about 95-99% or so of my data, including all critical items. It was a disorganized mess I just spent two days organizing, but I am back up and running without having to use expensive data backup services. I am slightly bothered by that slight bit of missing data, but from what I can tell, it amounts to nothing more than a brief sketch of a lesson plan, a song or two from the iTunes store, and maybe a handful of attachments. Nothing to spend big bucks recovering, in other words.
    Now I will substitute my "infallible" backup system with a new one:
    1. Time capsule/time machine
    2. Complete online backups with Mozy
    3. Occasional bootable clones to the external hard drive I have that didn't get damaged.
    I think this will be the ticket!
    Thank you all.

  • Link on a pivot table to see the data behind summary figures

    Hello,
    I need your support because I am not sure if what I need to do is possible.
    I have a flattened table and I have created several pivot tables and slicers based on it. Once I have created the scenario I want to analyze (using slicers), I get some summarized figures in the pivot table. What I need is a way to put a link on those figures
    to allow me to see the data associated to them.
    For instance, if after applying some slicer I get one figure 3, another 2 and grand total 5, I need to see the 2, 3 or 5 records behind them filtered in the existing data (not just double-click and create a new worksheet) .
    Thanks in advance for your comments,
           Parseval

    Hyperlinks in pivots are not supported.
    There is some limited drill through functionality built into pivots, but you can't do a lot to configure how it behaves.
    If it is enabled, which I believe it is by default, you show be able to double click on a aggregated total and a new sheet will pop up with the underlying records.  If your measure is a relatively simple aggregation and the underlying data is a
    flat file then this should work pretty well.  The results can be unexepected if the measures are complex or there are a lot of underlying relationships in the model.
    The other possibility is to use the pivots ability to collapse/expand fields. If you can put the row ID for the individual records into the rows of your pivot beneath what ever aggregated row you are currently displaying, then you should be able to expand
    into the rows and see the lower levels of the "hierarchy".  By default, all rows in you pivot would be collapsed, but then a user could click the little plus sign next to the row label and expand it to see the underlying records.

  • If I delete a backup on iCloud, will that erase the data from that backup on my phone?

    I had to get a replacement iPhone 5 because of a faulty power button on my first one. In order to keep my data, I used iCloud to backup my phone and transfer it to the replacement. Now I have a backup of my old phone and the replacement and that really limits my available space. (1) Is there a way to merge these together? (2) If I delete the old backup, will the data transferred from it be deleted on the replacement? Sorry if this is confusing and thanks in advance for any helpful information.

    You can't merge backups.  Also, deleting a backup only permanently deletes it from iCloud; it doesn't do anything to the data currently on the phone.  If you no longer need your old backup go ahead and delete it.

  • How to get back the data from 'AddressBook.data.previous' ?

    Hi! First of all: After using iSync all my address book data were duplicated, and I deleted all duplicated data manually. Then, I resetted the iSync data under 'Advanced' in '.Mac Sync Preferences'. Unfortunately, iSync deleted all my AddressBook data. I found a file named 'AddressBook.data.previous' and another file named 'AddressBook.data.beforesave' in my 'home folder/Library/Application Support/AddressBook'. Looking carefully into that file, I saw all the data I lost before in it! - Thus, how can I restore that data back into my AddressBook now? Does anyone knows some help for me? Thank you for answering! - Greetings, Gisela

    Welcome to Apple Discussions.
    You only have a very limited opportunity to recover your data this way. You should make sure that the Address Book application is not running, then drag the AddressBook.data file to your desktop or to the trash. Duplicate the AddressBook.data .previous file, and rename it AddressBook.data by removing the trailing <.previous> string. Then, launch the Address Book.
    The application will read the contents of this renamed file, and display your contact records. You should regularly back up your contact records using the built-in Back up Address Book… option under its File menu. A similar option is available in iCal.

  • CUBE IS NOT CLEARING THE DATA ON CONDITIONAL SCRIPT(ISSUE WITH NULLIFICATIO

    Hi,
    I am using AWM 10.2.0.2.0A and database is 10g Release 2 to build a cube.
    Before the monthly incremental load I need to clear the old data.
    For clearing(Nullifying) the cube I am using the new "Clear" command.
    The Clear command has two options.
    A) clear all the data without using any limits and
    B) clear the current status. The option A is working perfectly fine. The issue
    is when we need to clear only two months of data from the cube and I am using
    Clear STATUS (option B )option.
    After the execution data is not cleared (cube
    is still showing the old data)
    Please find below the program...............
    (The cube is compressed and partitioned by year)
    shw tod
    aw attach olap_cview rw
    limit ORA_PAX_AGT_PRT_MEASDIM to all
    limit ORIGIN to all
    limit DESTINATION to all
    limit FAREBASIS to all
    limit POS to all
    limit DIS_NON to all
    limit int_onl to all
    limit airline to all
    "lmt time to v_time
    lmt time to '01/01/2005'
    rpr time
    "clear all from ORA_PAX_AGT_PRT_TOPVAR *** all data is deleted inspite of the
    above limit
    clear status from ORA_PAX_AGT_PRT_TOPVAR *** Nothing deletes
    upd
    cmm
    dfn junk vrb integer
    junk=1
    upd
    cmm
    junk=2
    upd
    cmm
    dlt junk
    upd
    cmm
    shw tod
    Any one can help me what I have to do to clear the cube.....................

    Hi Thanks for the input,
    I have question.
    I saw your program and my program whatever I submit in the discussion earlier.
    I also using JUNK=1 keyword in my program . The only difference in your program and my program is
    I am declare and assign JUNK=1 after the upd and commit ,In your program its immediately you are decalring and assing JUNK=1 after the clear status and two times JUNK=1 is assigned.
    Please clarify me is this will make any difference to giving the JUNK=1 immediately after clear status and after clear status,up,command....??
    In your program
    ================
    clear status from ORA_PAX_AGT_PRT_TOPVAR *** Nothing deletes
    dfn junk vrb integer *** need these lines (only second one if junk exists)
    junk = 1 *** to work around clear/update bug.
    upd
    cmm
    junk=1
    upd
    cmmjunk=2
    upd
    cmm
    dlt junk
    upd
    cmm
    shw tod
    In My program
    ================
    clear status from ORA_PAX_AGT_PRT_TOPVAR *** Nothing deletes
    upd
    cmm
    dfn junk vrb integer
    junk=1
    upd
    cmmjunk=2
    upd
    cmm
    dlt junk
    upd
    cmm
    shw tod
    This is my query...This update will helpfull for me to before proceeding my test...
    Thanks ,
    Nat

Maybe you are looking for

  • How to copy item value that contain a single quote(')?

    Hi, I have one "Copy" button in a APEX form. When user clicks it, it simply copy the item's values from the form to a new form by using APEX provided function behind the button- "Set these item values with these values". It is simple and works fine i

  • Sometimes RSCRM ABAP program is taking much time

    Hi, I am working in SAP BW 3.1 system. We have one RSCRM Abap program to send the data to Data stage team. We kept this process in process chain. Some times it takes much time. If i cancel that job and repeat this process it will complete in few minu

  • New SSD in T430, Windows not loading, tried everything...

    Hi there, I bought a T430 about a week ago. I'm not completely inept with computers: I successfully added another 4GB of RAM with no problems. Then I wanted to replace my HDD with my SSD. I know the SSD works because it was in another laptop. I put i

  • How to read data from Logical Database ADA for more than one financia year

    Hi, I need to read data from ADA logical database and ANLCV node for current financial year 2007 and for the next 3 years – 2008, 2009, 2010. When I do this using program attached below, I receive only data for one year, which is entered at the selec

  • DVD Audio- I want sound from sides, not r

    Is there any way to reconfigure so that surround sound from dvdaudio comes out of the side speakers instead of the rear when using a 7. setup?