OBIEE:Need formula for all characters to the right of the right-most space

Hi:
I need to extract the right-most word from a field that could have 2-3 spaces. Example: "Administration Main Boston" = "Boston"
Thanks-
Charlie Epes
Buffalo, NY

Okay, this took awhile, but it was a nice challenge. The following will work for CHAR fields that have up to 3 spaces. It will extract and display the last word that follows the last space. Again, this was designed to work for words with no spaces, one space, two spaces, and 3 spaces. Here is the code:
RIGHT(RIGHT(RIGHT(TABLENAME.COLUMN_NAME,LENGTH(TABLENAME.COLUMN_NAME) - POSITION(' ' IN TABLENAME.COLUMN_NAME)),LENGTH(RIGHT(TABLENAME.COLUMN_NAME,LENGTH(TABLENAME.COLUMN_NAME) - POSITION(' ' IN TABLENAME.COLUMN_NAME)))-POSITION(' ' IN RIGHT(TABLENAME.COLUMN_NAME,LENGTH(TABLENAME.COLUMN_NAME) - POSITION(' ' IN TABLENAME.COLUMN_NAME)))),LENGTH(RIGHT(RIGHT(TABLENAME.COLUMN_NAME,LENGTH(TABLENAME.COLUMN_NAME) - POSITION(' ' IN TABLENAME.COLUMN_NAME)),LENGTH(RIGHT(TABLENAME.COLUMN_NAME,LENGTH(TABLENAME.COLUMN_NAME) - POSITION(' ' IN TABLENAME.COLUMN_NAME)))-POSITION(' ' IN RIGHT(TABLENAME.COLUMN_NAME,LENGTH(TABLENAME.COLUMN_NAME) - POSITION(' ' IN TABLENAME.COLUMN_NAME)))))-POSITION(' ' IN RIGHT(RIGHT(TABLENAME.COLUMN_NAME,LENGTH(TABLENAME.COLUMN_NAME) - POSITION(' ' IN TABLENAME.COLUMN_NAME)),LENGTH(RIGHT(TABLENAME.COLUMN_NAME,LENGTH(TABLENAME.COLUMN_NAME) - POSITION(' ' IN TABLENAME.COLUMN_NAME)))-POSITION(' ' IN RIGHT(TABLENAME.COLUMN_NAME,LENGTH(TABLENAME.COLUMN_NAME) - POSITION(' ' IN TABLENAME.COLUMN_NAME))))))
To use this, do this:
1) Paste the code in Notepad.
2) Do a "Replace All" and substitue TABLENAME.COLUMN_NAME for "- Employee"."CRM Employee Branch"
3) Copy the transformed code and paste it in the fx of a dummy column in your report.

Similar Messages

  • How to make Adobe as your default viewer for all your PDF file instead of the Preview given? Thanks

    How to make Adobe as your default viewer for all your PDF file instead of the Preview given? Thanks

    you need to "Get Info" on the file first. Select it, right click and select 'Get Info' in the menu.
    In the window that pops up, near the bottom, the "Open With" drop down menu needs changed. If the drop down menu does not present the one you want, select "Other" and find it.

  • I need to download adobe acrobat 7. I had it on my old computer and need it for my new computer. I have the serial #. Where can I get that download?

    I need to download adobe acrobat 7. I had it on my old computer and need it for my new computer. I have the serial #. Where can I get that download?

    http://helpx.adobe.com/x-productkb/policy-pricing/creative-suite-2-activation-end-life.htm l. I think this is the link. However, you will need to use the new S/N if you need to do the activation. The Activation server for AA 7 was taken down. I am not sure this link is complete, but it might give you some idea. However, on WIn7 and newer, AA7 has problems and will only work with some workarounds, and then kind of clunky.

  • HT1420 I need to deauthorize all computers but itunes gives me the response that i cannot deauthorize all until October 22, 2012?  i do not believe i should have to wait

    I need to deauthorize all computers but itunes gives me the response that i cannot deauthorize all until October 22, 2012?  i do not believe i should have to wait

    Contact iTunes Store support staff through the report a problem links in your account history or,
    iTunes Customer Service Contact - http://www.apple.com/support/itunes/contact.html > Get iTunes support via Express Lane > iTunes > iTunes Store
    Explain to them why you feel you should not have to wait.  iTunes Store: About authorization and deauthorization - http://support.apple.com/kb/HT1420

  • I had previously purchased 56 songs, over a year ago. Tonight I purchased 22 more. It seems that I am being charged for all 78 that are currently in the library. How can this be stopped?

    I had previously purchased 56 songs, over a year ago. Tonight I purchased 22 more. It seems that I am being charged for all 78 that are currently in the library. How can this be stopped?

    I doubt that this is happening.  Why do you think that you are being charged for all 78?
    Did you buy them again?
    You only buy one download, so if you downloaded them again you would have to pay again.

  • Need information for all the Fields on Infotype 94.

    Hi all,
    I have a question on Infotype 94 which holds all the information  of I - 9 form.  I would like to know which field goes with what details when we are trying to take details from I - 9 Form. I need a example how would it look for a Alien authorized worker and a permanent Resident and US citizen.
    Please help me out in this issue.
    Thank you.

    Residence Status (Infotype 0094)   
    Definition
    Infotype 0094 allows you to store information regarding an employeeu2019s residence status, as well as information regarding the compliance with the Immigration Reform and Control Act (IRCA), which requires every employer verify that each person hired can prove via documents their identity, and their eligibility for employment.
    Structure
    This infotype is divided into two parts: the personal identification information section (the residence permit) and the employment verification section (the work permit).
    Personal identification
    This section stores the information for personal identification. The only field which is required on this infotype is Residence status. 
    The ID type field describes the type of documentation the employee presents to the company. You can also enter data for the issuing authority.
    The ID number is the number of the document provided by the employee to the company.  The Issuing date is the date on which the personal identification document was issued to the employee. This date must be the same as or later than the employeeu2019s date of birth.
    Lastly, the ID expiry date field is the date that the provided identification expires.
    If the expiration date is filled, and there is a value of A (Alien) in theResidence status field, then this transaction will automatically generate a transaction to store a deadline for the expiration of the work permit (infotype 0019, subtype 71).
    Employment verification
    This section stores the information for employment verification. The Work permit field stores the type of work permit. The Work permit number field stores the number of the document provided by the employee to establish work eligibility.
    The date issued and the issuing authority are also stored. The Expiry of work perm. field stores the date on which work eligibility expires. This field should only be filled for those employees who are not citizens
    http://help.sap.com/erp2005_ehp_05/helpdata/EN/2c/8323d0571111d182d40000e829fbfe/frameset.htm

  • Need formula for the sum of products

    how do i sum the product of b(x) and ah(x) from x=2 to x=97?
    is this the sumproduct function? i don't know the syntax
    here.

    If you are going to put the SUMPRODUCT in the B column with your other values, then you have two choices.
    1. Select the ranges of the data, not the entire columns. So instead of "B" in the function you'll have "B2:B97" and instead of "AH" you'll have "AH2:AH97". Or,
    2. Create a footer row and put the SUMPRODUCT in the footer row. You can then still use "B" and "AH" in the function versus selecting a range.
    As this is kind of a basic question about selecting cells and ranges for use in a function, I recommend taking a look at the User's Manual, available via the Help menu. Pages 121-122 of the English manual would be a good starting point for this subject.
    And I see I misunderstood your original question. I thought you were talking about b(x) and ah(x) as being formulas that are dependent on the variable x, not the columns B and AH.
    Message was edited by: Badunit

  • Extracting all characters of a postcode before the space

    I am trying to extract the first characters from a postcode into a separate field that can then be used as a parameter.  If i search on postcodes starting with (for example) M1, this is bring out not only M1 but also M11, M12, etc.
    I have found a While Constructs formula example in my training book that extracts the Surname from a field containing the FirstName and Surname.  I have recreated this and applied to my postcode field but it is bring out the characters AFTER the space in the postcode and not the characters BEFORE.
    Does anybody know how to reverse the following so that it extracts the characters BEFORE the space?
    stringVar PCode := {ADDRESS.POSTCODE};
    numberVar i:=1;
    numberVar Strlen := length (PCode);
    numberVar Result:= -1;
    while i <= Strlen and Result= -1 do
        stringVar Position:= Mid (PCode,i,1);
        if Position = " " then
            Result:= i;
            i:= i + 1;
    stringVar PostSearch := mid (PCode, Result+1, (Strlen-Result));
    PostSearch

    Hello Tracy,
    I am not sure how to help you on this however I have found an interesting code from one of the forums, see if that makes your life any better.
    Here's the code to extract the zip. what i did is checked for a number in the string, once i found it i checked
    for next 4 character if they are number (as zipcode is 5 digits). if all 5 character are number then i m assiging
    it to a variable and coming out of loop otherwise i m going for next charachter.
    creat two formulas
    1st formula name is  "zipcode" which has following code
    shared numbervar strlen := length({table.fieldname});
    shared stringvar zipcode := "";
    shared numbervar i := 0;
    shared numbervar a := 0;
    shared numbervar b := 0;
    shared numbervar c := 0;
    shared numbervar z  := 0;
    for i := 1 to strlen do
    if mid({table.fieldname},i,1) in ["0","1","2","3","4","5","6","7","8","9"] then
         a := i;
         b := i;
         c :=  i + 4;
         z  := 0;
         zipcode := "";
        for a := b to c do
        ( if mid({table.fieldname},a,1) in ["0","1","2","3","4","5","6","7","8","9"] then
             (z := z + 1;
              zipcode := zipcode &mid({table.fieldname},a,1);
              if z = 5 then
              i := i+strlen+1;
              zipcode)
         else
               zipcode;
    2. the 2nd formula is  "zip" which has folllowing code
         shared stringvar zipcode;
    now keep  both  the formula in the report and supress zipcode.
    You will get the zipcode
    As I said this is not mine, I took it from somewhere else however the way he did it, makes more sense.
    Let us know if this works.
    Regards
    Jehanzeb

  • Do we need Scenario for all to deploy to EXECUTION repository

    I am just trying to find this piece of information all over and could not find it(probably my search word may not be correct one)
    I have package (main one and generated scenario for that) which has scenario of other packages, some procedures as well as some interfaces. It's big junk of all the combination of objects
    My question is do we need to generate Scenario for all interfaces and procedures in order to promote to Execution repository
    OR just the main package's scenario and the child scenario is enough.
    I do not have scenario for Interfaces as well as odi procedures, do I need to generate scenario for all objects,
    Please any help would be greatly appreciated.
    I just found this link
    ODI Export Scenario, only main?
    As per the link I do not need to worry interfaces nor ODI procedures, which do not have a scenarios in DEV repository when go to EXECUTION repository.
    Please make me correct, if I am wrong
    Thanks,
    Edited by: user12236189 on May 11, 2012 4:12 PM

    You only scenarios to be taken to the execution environment.
    If a scenario calls other scenarios, then you need those child scenarios too.
    All the interfaces/procedures are not needed since they are already merged into your master package scenario

  • I am trying to get Menu Editor 1.2.7 to work globally for all users. I have added the .xpi to the extensions folder and it is not being installed auto-magically.

    I would like to have Menu Editor installed for all users. I attempted to put the .xpi file in c:\Program Files (x86)\Mozilla Firefox\extensions with the expectation that the user would be prompted to install.

    You need to rename the XPI file to the (GU)ID of the extension as listed in the file install.rdf or just install the extension in a profile and copy the file or folder from that profile to the extensions folder.

  • Need formula for drawing method

    I need help figuring out a formula for a
    dynamically-generated diagram. Of course the lines will be drawn
    using the AS drawing API and I know I will need six coordinates
    total (the start point, the moveTo point, the curveTo point, the
    anchor point, and the end point) to draw the line.
    The position of both start and end points will be dynamic.
    Please see the diagram at the link for exactly what I need.
    http://www.themassivedump.com/uploads/drawing-logic.gif
    I don't really know where to begin. If there are any geometry
    wizzes out there, your help would be GREATLY appreciated.
    Thank you in advance!

    here you go. you just need to add your curveTo, if you think
    it's worthwhile.
    i assumed your red dot and blue dots have central
    registration point:

  • Outputting all formulas for all members

    Hello,
    I need to get all the formulas in my ms word documentation. Is there
    a way to dump all of them into a file/output rather then clicking through my hundreds of
    members to get the formula?
    thanks,
    metalray

    Hi,
    You could use [OlapUnderground Outline Extractor|http://www.appliedolap.com/default.asp?ID=51] to extract member information to a file.
    Or you could use ODI though if you have not used ODI before it will be quicker to just use the outline extractor.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • I just purchased Time Capsule today.  I ONLY want to use it as an external drive.  I do not need it for Time Machine. I can see the TC in my finder, but when I click on a file or video to drag and drop, I get message that TC can't be modified. Help please

    I just purchased Time Capsule today.  I ONLY want to use it as an external drive.  I do not need it for Time Machine. I need to free up room on my computer. As of now, I can't even load updates. I can see the TC in my finder, but when I click on a file or video to drag and drop, I get message that TC can't be modified. Help please!

    I agree with Kappy.. passing files and especially via wireless is slow as slow.
    Just need to be sure your TC is the new AC model??
    And the OS on the computer is Lion?
    Have you completed the setup of the TC via the utility? You do still need to get internet via the TC so it has to be plugged into the main router..
    Give us the full picture of the network.
    Then we can help you get into it.. whether you should put your files on it is another question.

  • I deleted Bonjour, since I don't need it for remote printing.  Now I get the message " Airport Base Station has stopped working: and also a message saying APAgent.exe can't be found.  What to do??? Thanks.

    I deleted Bonjour since I don't need it for remote printing.  Now on start-up I get the message: "Airport Base Station Agent has stopped working" and also message: "can't find APAgent.exe.:  Do I need AP Agent??  What to do??  Thanks. 

    The APAgent monitors your AirPort base station and informs you if there are things like firmware updates available. This utility relies on Bonjour, but is not required for base station operation. However, Bonjour makes it easier for your PC to "find" the base station via the AirPort Utility and I would recommend that you keep it installed. If you don't want the APAgent, you can just use the Apple Updater utility (that was also installed when the AirPort Utility was installed) to remove it.

  • How to make it a default for all received messages to not preview the attachment but instead show the icon? (mac mail.app)

    Hi
    I am having trouble with large incoming mail attachments.
    When I receive a large attachment (pDf) the useful mail preview feature attempts to show a preview of the attachment.  Unfortunately this is causing a lot of trouble as some PDFs are extremely large and therefore take time to open/preview.   If I right click the attachment and select view as icon, the problem with that specific message ceases as the attachment is no longer previewed.
    How can I make it the default for all attachments in received messages to only be shown as a icon and not previewed?

    In Terminal,
    defaults write com.apple.mail DisableInlineAttachmentViewing -bool Yes

Maybe you are looking for

  • Can I use USB 3 with my 2.8Ghz Quad-core

    I have an early 2008, 2.8 GHz Quad-Core Intel Xeon Mac Pro, can I use USB3 Devices with it?

  • Bug with 3D animations

    I noticed a bug when trying to animate movieclips in 3d space: Basically the bug occurs when trying to tween a movie-clip in 3d space across a z range that is greater than 5000 or so, which then results in very odd behavior (see end of movie above).

  • Release RFQ

    Dear Sappers, I'm configuring RFQ release.I've taken charcteristics as Purchase group and assign the respective values.In Class I've maintained the PO release i.e net order and RFQ i.e. release group.In Release Strategy, I'm created two different rel

  • [SOLVED] Audio setup troubles with usb headphones and built-in sound

    Hello, I Just started using Arch about a month ago after going through many Debian and Ubuntu variants.  After all my frustrations with apt pinning to get working 10bit video playback, only to have everything else uninstalled by crappy dependency che

  • Trying to access backup of other mac on time machine that backs up two macs

    Hi there, Is there anyone that can help me: I have a MacBook Pro and a macmini, both are backed up on the same time capsule. At the moment I am unable to use my MacBook and desperately need to access some files from the time capsule. I can access tim