Formatting formula help

I am trying to format a string that appends leading zeroes to a number based on it's value..... but I'm getting decimals in the final product, and want to format it to drop the decimals. Here is the formula:
if (Sum ({tblOutlets.Sun}, {@PBS_rt})<10) then "000"&Sum ({tblOutlets.Sun}, {@PBS_rt})
else
if (Sum ({tblOutlets.Sun}, {@PBS_rt})<100) then "00"&Sum ({tblOutlets.Sun}, {@PBS_rt})
else
if (Sum ({tblOutlets.Sun}, {@PBS_rt})<1000) then "0"&Sum ({tblOutlets.Sun}, {@PBS_rt})
else
if (Sum ({tblOutlets.Sun}, {@PBS_rt})<10) then ""&Sum ({tblOutlets.Sun}, {@PBS_rt})
if my output is "0021.00" and I want "0021"...... how can I accomplish that with formatting in the formula?
Thanks in advance for indulging the frustrated.....

You're making it too tough. Try this...
ToText({@YourFormula}, "0000")
This will yield a minimum 4 digit integer number with no decimal places.  Bear in mind that no rounding will occur. It just drops the decimals.
12.3 = 0012
1.3598 = 0001
112548.25 = 102548
112548.85 = 102548
If you want additional leading 0's just add them between the ""
ToText({@YourFormula}, "000000000")
12.3 = 0000000012
1.7598 = 0000000001
112548.25 = 0000102548
112548.85 = 0000102548
HTH,
Jason

Similar Messages

  • Chart (Graph) Font Name - Formatting Formula

    Hi,
    I am displaying chart in report, and I have requirement to select (format) font name with some condition (e.g.. As per database language, if database is english - Font Name: "Times New Roman", if database version is Spanish - Font Name: "Arial" etc.)
    Currently I am trying to add "Font Name" formula for x-axis in Graph by "Formula Fields -> Formatting Formulas -> Report Footer -> Report Footer A -> Graph2" and Right click "New Font Formula -> Font Name -> Use Editor", but nothing happens. I tired and noticed It works for "Background Color" .
    Please let me know, how can I add Font Name formula for Graph.
    Note: I am working with Crystal XI
    Edited by: loveuhameshah on May 31, 2011 8:18 PM

    Vamsee,
    Thanks for your reply.
    You are right, I also want to format x-axis field values but how can I reach (access) to "x-axis" field formatting formula for Graph. In Formula Workshop I can find hierarchy upto Graph level only, I cannot find any node such as X-axis, Y-axis under it.
    [Image|http://i837.photobucket.com/albums/zz297/essenceofarts/Graph-format-font.jpg]
    Looking forward to any suggestion or help.
    Thanks,

  • Storing a conditional formatting formula in a variable

    I have a conditional formatting formula that exceeds the 393 character limit for Word fields. I've placed the formula directly into the template table, and it works correctly. But now, of course, there are several hundred characters of formatting information in that cell, along with the data field. Not pretty.
    Is there a way to store that long formula into a variable, and then refer to that variable as the conditional format? I'm getting stuck on the right-arrow tags (>). I can't figure out how to include those in the string and store them in the variable.
    Here's a simplified example of what I'm trying to do:
    <?xdoxslt:set_variable($_XDOCTX,'myvar',"<?if:number(Sales) gt 1000000?><?attribute@incontext:color;'red'?><?end if?>")?>
    The inclusion of the right-arrow tags (>) in the string causes a failure when attempting to Preview. If I replace all of the right-arrow tags with something else, like the number 8 ...
    <?xdoxslt:set_variable($_XDOCTX,'myvar',"<?if:number(Sales) gt 1000000?8<?attribute@incontext:color;'red'?8<?end if?8")?>
    ... the string is stored in the variable, and I can refer to it in the template table by using <?xdoxslt:get_variable($_XDOCTX,'myvar')?>. It's useless, of course, but it works correctly. The string is stored in the variable, and the contents of the variable appear in the template.
    So how can I imbed the right-arrow tags in this text string? Use an escape character? Imbed the ASCII code? I'd do either of those in a heartbeat if I could figure out the right syntax.

    Related information is available at:
    Where to put xsl:variable definition

  • Error while processing conditional formatting formula in crosstab

    This conditional formatting formula must return one of the following Color Constants: ' A number, currency amount, boolean, date, time, date-time, or string is expected here. Details: errorKind
    The above error is displayed on the the Business Objects Report Server when running my report.
    The XI server version information is as follows:
    BusinessObjects Enterprise XI Release 2
    Business Objects
    11.5.0.3135
    20060628
    Crystal Reports XI Release 2
    Business Objects
    11.5.0.31327
    20060628
    My IDE is Crystal Reports 2008.
    The error is being generated for the following conditional formatting formula which is in my crosstab:
    evaluateafter ({@concatAppTypeAppMethod});
    if CurrentRowIndex = 1 then
        color(0,153,153)   
    else if CurrentRowIndex = 2 then
        color(168,146,101)
    else if CurrentRowIndex = 3  then
        color(0,51,153)
    else if CurrentRowIndex = 4  then
        color(204,51,51)
    else
        color(153,153,153)
    This formula is applied via the Crosstab "Format Field>Font" tab.  In the report developer (Crystal 2008) the report runs without error.  When deployed to the server it fails with the above error.
    Heres the details of {@concatAppTypeAppMethod}:
    whileprintingrecords;
    "Designs filed " + {Command.APPLICATION_METHOD}
    The crosstab is structured as:
    Row = {@concatAppTypeAppMethod}
    Column = {@getMonth}
    Summary = Count of {@concatAppTypeAppMethod}
    Details for  {@getMonth}:
    right(totext(year({Command.ACN_COMPLETED_DATE}),"#"),2) + totext(month({Command.ACN_COMPLETED_DATE}),"0#")
    The above functions Row i.e. {@concatAppTypeAppMethod} and {@getMonth} use fields from the SQL command. 
    {@getMonth} parses the ACN_COMPLETED_DATE field, obtains the record month and year and concatenates these as a string which can be displayed as follows in the crosstab:
    May-08, Jun-08 etc.
    {@concatAppTypeAppMethod} parses the APPLICATION_METHOD field and obtains the application filing method i.e. Online or Internally and concatenates the pretext "Designs filed " to the filing method (also a string).
    I have tried various combinations of whilereadingrecords, whileprintingrecords and evaluateafter() with no success.  The problem occurs because the conditional formatting formula is being executed before the records being formatted are ready. 
    I believe this is a problem with the crystal reports software and/or XI server. 
    Please prove me wrong.

    Hi Raghavendra,
    Thanks for your prompt answer!  Can you confirm?  Is it because I'm using calculated members in the report and these are not support by the XI server specified in my error report above?
    If so, do you have any suggestions with regard to how I might be able to create a graph with the following attributes:
    Show summary (count) of records per month per application method (i.e. online or internal. this is a database field retruned by the SQL command).  In addition I need to add a series to the graph that shows the totals number of records per month irrespective of the relative application method (i.e. sum of online and internal) and finally I need to show the total number of online applications (i.e. application method = online) as a percentage of the total number of applications for the month.

  • Hello i am rajesh i am having problem while conveting other files into pdf format please help me

    i am rajesh i am having problem while converting other files into acrobat format please help me

    Hello Rajesh,
    I'm sorry to hear you're having trouble. Are you using Acrobat.com to convert your files to PDF? Please let me know where you are having trouble and I will do my best to help you convert your files. For your reference, here is a list of filetypes that can be converted to PDF online with Acrobat.com:
    http://kb2.adobe.com/cps/524/cpsid_52456.html#Create%20PDF
    Best,
    Rebecca

  • Displaying "N/A" in report fields where Number data is not valid using a formatting formula

    Post Author: Horizon57
    CA Forum: General
    I have many reports which are populated by "Number" data. However, there are certain charts and tables where the number data is not appropriate and the summation of such data does not add value to the report. In these instances I would like to display "N/A", however the formula I am using keeps giving me an error that I need to use a "Number" data type. Please note this is a formatting formula.
    Formatting Formula
    DO{TREND.EPTP1} = 'N/A' AND{TREND.EPTP2} = 'N/A' AND{@Trend %}    = 'N/A'  WHILE {TREND.POS2} = 'TOTAL';
    Can anyone assist me with displaying "N/A"?

    Post Author: V361
    CA Forum: General
    Try this
    DOtotext ( {TREND.EPTP1} ) = 'N/A' ANDtotext ( {TREND.EPTP2} ) = 'N/A' ANDtotext ( {@Trend %} )    = 'N/A'  WHILE {TREND.POS2} = 'TOTAL'; 

  • Format for help which will actually help

    There is absolutely no room for sarcasm or ignorant answers as this doesn't help anyone. Even grammatically correct sentences are wasteful.
    Basically through troubleshooting my own problem I've devised a format that would have helped me had adobe or even another user simply followed this format instead of pages of impossible to navigate "problems" and "solutions" that never truly apply to what I'm experiencing. We've all been there.
    Please restrain from wasting digital ink by responding to this out of ignorance assuming I haven't done some incredibly simple step.... don't insult my intelligence, its rude and destroys any faith in this company or its community of users. By the time you make it to the forums its a guarantee you have already restarted your computer, uninstalled/re-installed, repaired permissions, and lord help you, checked for an update........ the last one, the absolute last thing anyone wants to hear.
    Specifically I have been dealing with error 1301: unable to update adobe reader because the file has been modified since last update.
    I could say a bit of comedic lines on this, since there isn't enough hours in the day for me to even think about rooting around adobe reader files, aint nobody got time for that.... but I won't because I want people to be helped by this article.
    Begin improved format:
    problem:
    error 1301 when updating acrobat reader, files modified since last update
    versions:
    Mac OS X 10.7.5 operating system
    (also adobe reader version when problem began, did not have access to this information at the time of this writing, probably around version 4.3 though )
    precedent:      (in order so it is possible to follow the persons trouble shooting path)
    1. restarted computer
    2. uninstalled and re-installed adobe reader ---------upon next update same error appeared----------
    3. followed these steps for root login  http://support.apple.com/kb/ht1528 per the instructions from the link (details) that was displayed in the error window http://helpx.adobe.com/acrobat/kb/troubleshoot-update-errors-acrobat-reader.html
    Question(s):
    1.with the root enabled do I just install adobe reader in the root account, and if so will that mean adobe reader will be available in my account? (they are different logins even though my account is the administrator)
    2. will I have to leave the root enabled? (it is recommended to disable the root if you do not use it often per the above linked instructions)
    3. Are my security settings interfering with adobe's attempts to update? ( I have a firewall, my hard drive is encrypted and my system settings all require administrator password when doing anything)
    end of a well formulated post
    What I hope is accomplished by this post:
    1. that this problem will be addressed (for real) in future updates.... since the world relies on this software it has to work and work every time without wasting client time, that is adobe's burden and one they rather like since they get a lot of money off of it.
    2. that this community will start posting questions in ways that problem trends can be easily recognized, and easily navigated by reducing the amount of complaining posts where everyone voices how they all have the same problem, but no one has an answer worth reading.
    No one has time to scroll through long pages of sarcastic complaints.

    example response:
    I'm also curious if there is any interference with updates when you have adobe reader and acrobat pro installed

  • Format & Formula Bars

    Question is there any way to enlarge the Formula Bar and Format Bar in Numbers? The tools are so small and difficult to read.
    Dick

    Question asked and responded several times!
    The response is no.
    _Go to "Provide Numbers Feedback" in the "Numbers" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'09
    You may change your display rez.
    +-+-+-+-+-+-+-+-+
    Worried Life Blues 2008
    Discussions
    +Apple Discussions, launched in August, 2000, have grown rapidly in usage and features. The main features include personalization, subscription capabilities and email capabilities. _For information on how to use Discussions, please visit the Discussions Help Page_. Cookies should be enabled and an Apple ID account is required if you would like to contribute to the discussions.+
    +*What is Apple Discussions and how can it help me?*+
    +
    Apple Discussions is a user-to-user support forum where experts and other Apple product users get together to discuss Apple products. … You can participate in discussions about various products and topics, find solutions to help you resolve issues, ask questions, get tips and advice, and more.+
    +_If you have a technical question about an Apple product, be sure to check out Apple's support resources first by consulting the application Help menu on your computer and visiting our Support site to view articles and more on our product support pages._+
    +*I have a question or issue*—+
    +how do I search for answers? _
    It's possible that your question or issue has already been answered by other members so do a search before posting a question._ On most Apple Discussions pages, you'll find a Search Discussions box in the upper right corner. Enter a search term (or terms) in the field and press Return. Your results will appear as a list of links to posts below the Search Discussions Content pane.+
    +Search tips are available here:+
    +http://discussions.apple.com/help/search-tips.html+
    +-+-+-+-+-+-+-+-+
    Yvan KOENIG (from FRANCE samedi 30 août 2008 20:45:12)

  • Conditional formula help

    Post Author: scd07
    CA Forum: Formula
    Hi, Crystal Reports novice here...
    I have been asked to take out any lines in several reports with all "0s" in the columns.  I have tried formatting each field to suppress Zeros and then right click on the Description column and click "suppress if blank".  Didn't work.  I then tried to write a conditional formula that I put under the description field (field 1), "common", "formula" and "suppress".  The formula followed the following:
    If = 0 and = 0 and = 0 then true else false
    Unfortunately this also didn't work.  I don't know if my formula is incorrect or if I am entering it in the wrong spot.  Any help would be very much appreciated!  Thank you!!

    Post Author: Bandit07
    CA Forum: Formula
    Right click on what you want to suppress and click the x-2 button next to suppress.  Put your formula in there.
    = 0 and = 0 and = 0,  If all of these conditions are true then it will suppress.
    B

  • Date format formula

    simple question (sometimes you forget the basics!!!)
    how do i format a date in a formula
    basically i want to say if country <>'US" then date(),'YYYY-MMM-DD')
    i keep getting to many arguments
    thanks

    Hi
    I used this formula
    IF 1 = 1 THEN
        DATE(CDBL({Command.FULL_DT}[7 TO 10]),CDBL({Command.FULL_DT}[4 TO 5]),CDBL({Command.FULL_DT}[1 TO 2]))
    ELSE
        CURRENTDATE
    It looks a bit messy but the parameters of the DATE function need to be numbers
    My data field ({Command.FULL_DT}[ looks like this : 01/01/2010, and it is a string
    Hope this helps
    Patrick

  • Formula help when offline

    Hi,
    the numbers "formulas and functions" help seems to have moved to the internet, which I am pretty upset about. Now, when I don't have an internet connection (I travel a lot), where can I find the help about the formulas and funcitions? The built-in help only has a list fo links to the online version.
    Thaks
    p.

    papalapapp wrote:
    Thank you. I used the "print" funcionality on the website to save a pdf-version, but it is by no means a replacement for the former built-in help which was really good. I hoped that there might be at least an optional installation.
    You are the first one on the forum, to my knowledge, who likes the help function. It's slow and difficult to navigate for most of us. The PDF guides are searchable with the Find function in Preview. The Function Browser, as Wayne notes, is also quite handy and always quick to launch. Another way to launch the Function Browser is to click the function icon on the Format Bar when you are editing a cell's content.
    Jerry

  • Visibility formula help

    Hi All,
     I want to calculate a formula, depending on that formula, I want to hide and make the column visible.  I have a column called
    SN. I want to make it visible when the value of the parameter called @section is “GCG” otherwise I want to make it invisible. Same thing with another columns, if @section parameter is “GED” then I want to make column 2  called PN visible and column SN
    invisible. I tried to calculate this formula and putting it in Visibility-hidden formula section
    IIF(INSTR(Join(Parameters!section.Value), "GCG") > 0 OR Parameters!section.Value(0) = "-1", false, true)
    the above formula didn’t make that particular columns visible/invisible
    Alternatively, I tried putting the formula in the XML file for the report.
    <TableColumn>
    <Visibility> <Hidden>=IIF(INSTR(Join(Parameters!comp.Value), "GCG") > 0 OR Parameters!comp.Value(0) = "-1", false, true)</Hidden> </Visibility>
    <Width>1in</Width>
    </TableColumn>
    The above formula seems to be working, but the problem is when I export the
    report to the Excel. The column that I am making visible by the above formula is not exported to excel.
    I am not sure what am I doing wrong, but I am struggling with this issue for
    past two days.
    The value in the @section parameter can be “GCG” or “GED” or “PED” or all three
    of them “GCG”,”GED”, “PED” or two of them “GCG”, “PED”, it can be any combination. If I am passing the combination of two parameters then I want two columns to be visible and other invisible.
    any help or hint will be greatly appreciated. I am struggling for a while with this issue.

    Hi Anjali100,
    According to your description, you have used expression to control the visibility of columns in your tablix. However, when exporting into CSV file, it still shows all columns which some of columns need to be hidden. Right?
    In Reporting Services, when exporting to CSV/XML file, as mentioned in the link you post, these two are only data renders, it will not render any interactivity like Hide, Hyperlink... Please refer to the "Interactivity" in the link below:
    Exporting to a CSV File (Report Builder and SSRS)
    And as we tested in our local environment, it doesn't automatically omit the data in those columns which has set Hide. So your requirement can't be achieved in CSV format currently.
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Basic formula help

    HI Sorry for the simple questions but have been off this product for many years.
    I have a code coming in from the database that is '1' for Male and '2' for female and I need the report to show 'M' and 'F'.
    TIA,
    Phil

    Hi Philky,
    Drag the field into the report.Right click on the field and click on Format field. Go to the Common tab and click the formula editor button infront of the Display String field. then type in the following formula:
    if {Field name}= 1 then 'M' else "F'
    click OK and refresh the report.
    Hope this helps you!
    Regards,
    Anindita

  • 5th Gen iPod error while formating please help

    Ok here is the long and complicated story. I had a iPod Mini 4GB and thought it was time to upgrade to a 30GB. itunes and everything working just fine up to the point where I went and loaded the ipod disc to format my new iPod. I incountered a iPodDeviceInternal assert error when the program started to format the iPod and failed to complete the install. I tried over and over again. I loaded itunes and it said that the iPod could not be Recognized and that i should reinstall itunes. I then went to Best Buy were I bought it and took it to the Geek Squad tech. center and he hooked it up and it worked fine,then telling me to try downloading the newest version of itunes. I did and it installed fine...but when i click it, it doesnt open. so baically I cant get itunes to open and my iPod will not format. Please Help me

    Can you see iPod drive under Removable disk in My Computer?
    If so,try disk defragment on it or manually format your iPod and lastly redo the whole installation process

  • External drive no longer mounts or unmounts or formats. Help!

    I have a 1TB external Seagate drive which is used to store my time machine backup for an iMac (2010).  My time machine is failing as it says there is no backup disk.  I ran disk utility.  I see it on the external drive on the list below the line on the drive listings.  I see the external drive and the time machine volume indented below it.  I verified the external disk and it says it is fine.  However it will not let me mount the external drive or the time machine partition.  I cannot even re-format the disk because it says it cannot be unmounted (which is obvious it it does not let me mount it).  It is connecting to the drive because it can see the verify results.  I also tried every combination of unplugging power and cables to both the unit and the Mac itself.
    Question(s):
    1.  Is there anyway to remount the external seagate drive?
    2.  Can I format it without mounting it.  I don't care if I lose anything as it is all time machine backup files only
    3.  Do I need to format it on my windows PC and then reformat it again on a Mac!?
    Help I am at my wit's end!!
    Thanks
    RZ

    Disk Utility - Format,  Erase,  or  Reformat  a  Drive

Maybe you are looking for

  • BBM & Email stop working every morning...​.

    Every morning my BBM, Whatsapp, Email and Facebook notifications stop working.... BBM has a red clock when sending and doesn't receive and the others don't receive or send anything... The only fix has been pulling the battery or doing a soft reset wi

  • Hp officejet 4500 wireless won't print from laptop. It is connected to laptop.It prints from desktop

    We have a HP Officejet 4500 wireless printer which was first installed in 2011 without any problems. We also utilize a HP LaserJet P1006 printer (not wireless) with our network. I cannot print from my laptop to either printer, but hubby's desktop has

  • Dreamweaver browser compatibility

    I wrote a simple little BMI calculator that was putting the result in a span. Because I wanted to clear all fields, I modified the javascript to put the calculated result into a form input field. Now, the calculator works in some browsers and not oth

  • Firewire port status on cisco 435HDC?

    Is there any advanced diagnostic screen to see what the status of this port might be? I knew how to get to it on the Motorola boxes but can't find anything similar for this new hardware.

  • Are there known problems with mountain lion download?

    My iMac will not longer boot up after downloading Mountain Lion. I am also now unable to boot from the Snow Leopard disk. Has anyone any ideas?