How to calculate length of the string in transformation file

Hello all
I have tried a number of ways and I am not able to calculate the length of the incoming field in transformation file for my data load. Here is the issue.
I have an incoming string of length 10 and I need to use it to update multiple dimensions which will need first 2, 4 ,6 , 8 characters respectively.
Now in transformation file ID=ID(1:2) works perfect. However, the BW InfoObject will have multiple values as shown below:
ID
Description
AB
Business
ABCD
Business Organization
ABCDEF
Business Line
ABCDEFGH
Product Family
ABCDEFGHIJ
Product Line
ABCDEFGHIJKL
Brand
I want to update my dimension for Business Organization. I need to update only the records where the length of the incoming string is 4. If I do ID(1:4), I will get the duplicate records and will see the ID less than 4 characters in rejected records. The latter is not such a big issue but the former one is as I need to fetch the right description as well. The formula should check the length and then only pass the record else a dummy value.
A formula to achieve this in the transformation file is what I am looking for.
Regards
Gajendra

Thanks Vadim for the quick response!
I am also trying something similar and really appreciate your input here. However, I am not sure if the conversion is really happening.
Here is what I have done:
But the strings <> 4 in length are still passing through.

Similar Messages

  • How to find the total length of the string drawed in a rect?

    Hello Everybody,
    I am drawing a string in on one rect using drawInRect method. This drawInRect method gives us a return value as size of the rect. I need length of the string that is did draw in that rect, but didn't find any api to do this.
    Can anyone tell me , how find the length of the string which we did draw in rect?
    Any help regarding this issue , is highly appreciable.
    Thanks,
    Pandit

    Hi Adreas,
    First of all, very thanks for the response.
    Actually , I am looking for other thing. Using drawInRect method I am drawing contentString in self.rect like below.
    //code
    [contentString drawInRect:self.rect withFont:[UIFont fontWithName:@"Verdana" size:14.0] lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentLeft];
    //End
    My contentString is much larger string, so I am not able to draw it in rect(length: 320.0 height: 460.0) completely. My rect is showing only a part of a contentString. So I need to get that part of string which did draw in the rect, so that I can process my contentString to get the remaining string to draw it a next rect.
    The above code statement is returning me the CGSIZE , it is giving the size of the rect but not giving any information of the string which get draw in that rect.Do you have any idea how to do this?
    Any information on this is highly appreciable.
    Thanks,
    Pandit

  • Length of the string passed to rwcgi60 in Oracle 6i

    Hello,
    I am running the report from the web. The url will be something like
    http://localhost/cgi-bin/rwcgi60.exe?server=repserver+report=.rep+all the input parameters.
    When the length of the string passed from report= execeeds certain limit(indicated by dashes) I am getting the cgi error
    Error: The requested URL was not found, or cannot be served at this time.
    Oracle Reports Server CGI - Unable to communicate with the Reports Server.
    If I remove some of the select criteria then I could execute the report from the web.
    Any body has any soln. for this.
    Thanks in advance,
    Vanishri.

    Vanishri
    The limit is very high and you should not be hitting this problem. There are couple of fixes done in this area. Please apply the latest patch (Patch 10) and try.
    Other solution is you can have a mapped key in cgicmd.dat file and use the key alone in the URL. In the cgicmd.dat file, you have to map say
    key1: REPORT=your_report.rdf USERID=user_name/password@mydb DESFORMAT=html
    SERVER=repserver DESTYPE=cache
    Please refer to the Publishing reports or Reports services manual at http://otn.oracle.com/docs/products/reports/content.html
    Thanks
    The Reports Team

  • PowerShell: Want to get the length of the string in output

    Hi All,
    I am typing this but it is not working. Does anyone know what I could be doing wrong.
    The command I wrote is:
                         GCI -file  | foreach {$_.name} | sort-object length | format-table name, length
    But it is not working. I am expecting a name of the file and length of the string like 8 characters etc. my file is called mystery so it should have 7 as its output of the name, length.
    Thank-you
    SQL 75

    Get-ChildItem supports both  -File and -Directory.
    Help will help:
    https://technet.microsoft.com/library/hh847897(v=wps.630).aspx
    Read the first couple of parameters to see.
       GCI -file  | sort-object length | format-table name, length | ft -auto
    Seems to be a rasher of bad answers to day.  YOu were just extracting the name property then trying to sort on a property that doesn't exist.
    Do the sort first then select the properties.
    it helps to test answers before posting.  I know because I get bit by posting without thinking to often.  I have to remember to think first.
    ¯\_(ツ)_/¯

  • Want to length of the string

    Hi,
    I have one parameter on the selection screen, when i enter some string on that, it should give me the length of the string. can you pls send me the code.
    Ex: if i enter : enter amount : then it should give the o/p is: 12
    Akshitha.

    use FM
    SWA_STRINGLENGTH_GET  
    enter your string in EXPRESSION and use the others if needed use "X" for all three except EXPRESSION
    EXPRESSION                      GFFHG      
    <b>CONDENSE_NO_GAPS                           
    CONDENSE                                   
    WITH_LEADING_BLANKS                        </b>
    also see STRING_LENGTH
        STRING_LENGTH
    Message was edited by:
            Amit Singla

  • How to read and update the value of property file

    Hi,
    I am not able read the values from property file.
    Please tell me how to read and update the values from property file using Properties class
    This is my property file : - Config.properties its located in D:\newfolder
    Values
    SMTP = localhost
    Now i need to change the value of the SMTP
    New value :
    SMTP =10.60.1.9
    Pls Help me
    Thanks
    Merlin Rosina,

    Post a small (<1 page) example program that forum members can copy and run that demonstrates your problem.

  • How to load and display the external flv video files in dynamicly and the how to control the flv fil

    How to load and display the external flv video files in dynamicly using AS 3.0
    and  How to control the flv file  add the play paus button and add seekbar.
    I have using to load the flv file following code
    var flvPlaceHolder1:MovieClip = new MovieClip();
    var vid1:Video = new Video(734, 408);
    flvPlaceHolder1.addChild(vid1);
    addChild(flvPlaceHolder1);
    flvPlaceHolder1.x = 1059;
    flvPlaceHolder1.y = 152;
    var nc1:NetConnection = new NetConnection();
    nc1.connect(null);
    var ns1:NetStream = new NetStream(nc1);
    vid1.attachNetStream(ns1);
    var listener1:Object = new Object();
    listener1.onMetaData = function(evt:Object):void {};
    ns1.client = listener1;
    ns1.play("GV-1600 TURNING.flv");
    ns1.addEventListener(NetStatusEvent.NET_STATUS, statusChanged1);
    function statusChanged1(ns1:NetStatusEvent):void
             trace(ns1.info.code);
            if (ns1.info.code == 'NetStream.Buffer.Empty')
                 trace('the video has ended');
                 removeChild(flvPlaceHolder1);
                 //trace('removeChild');
                gotoAndPlay(1786);
    then how to add the play,paus ,full screen button    and   seekbar,volumebar.

    I have to Create the flash presentation for our company product
    In this presentation the left  side the text animation are displayed then right side the our product video is displayed.
    In this presentation i need the following option :
    1, The first product video and animation is finished then the next product is played
    2, then the video displayed  (size width and height 400x300) , I click this video to increase the size(ex:1000x700)
    3, then the playing video i control  it play, stop, paus button and volume bar, seek bar.
    4, then this presentation is displayed on 42 inches LCD TV so this full presentation is run full screen.
    I have finished first two steps 1 and 2
    the following are the screen short and code:-
    code :-
    var count=0;
    var flvPlaceHolder2:MovieClip = new MovieClip();   
    var vid2:Video = new Video(734, 408);
    flvPlaceHolder2.addChild(vid2);
    addChild(flvPlaceHolder2);
    flvPlaceHolder2.x = 1059;
    flvPlaceHolder2.y = 152;
    var nc2:NetConnection = new NetConnection();
    nc2.connect(null);
    var ns2:NetStream = new NetStream(nc2);
    vid2.attachNetStream(ns2);
    var listener2:Object = new Object();
    listener2.onMetaData = function(evt:Object):void {};
    ns2.client = listener2;
    ns2.play("GS-4000.flv");
    this.addEventListener(Event.ENTER_FRAME, BtnFadeIn2);
    function BtnFadeIn2(event:Event):void
        if (this.currentFrame == 387)
            /*flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            trace('Screen size is changed');*/
            if(count==0)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            count++;
    ns2.addEventListener(NetStatusEvent.NET_STATUS, statusChanged2);
    function statusChanged2(ns2:NetStatusEvent):void
        trace(ns2.info.code);
        if (ns2.info.code == 'NetStream.Buffer.Empty')
                trace('the video has ended');
                 removeChild(flvPlaceHolder2);
                 //trace('removeChild');
                gotoAndPlay(433);
    flvPlaceHolder2.buttonMode=true;
    flvPlaceHolder2.addEventListener(MouseEvent.CLICK,home2);
    function home2(e:MouseEvent):void
        if(vid2.width==734 && vid2.height==408)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
        else
            flvPlaceHolder2.x = 1059;
            flvPlaceHolder2.y = 152;
            vid2.width=734;
            vid2.height=408;

  • How to calculate sum of the fields in adobeforms

    Hello Experts
    can  i know how to calculate sum of fields in the adobe form.  I have few fields to be summed in total field.
    Regards

    Hello Surendra,
         Suppose you are having 4 fields and the 4th field is the TOTAL field.
         Write the below Javascript on the Initialize event of TOTAL field as shown below.
    Remember that if you use just "+" sign without Number() or ParseInt() function it acts like String Concatenation.
    this.rawvalue = Number( this.parent.field1.rawvalue ) +
                          Number( this.parent.field2.rawvalue ) +
                          Number( this.parent.field3.rawvalue ) ;
    You can also write is as shown below.
    this.rawvalue = parseInt( this.parent.field1.rawvalue ) +
                             parseInt( this.parent.field2.rawvalue ) +
                             parseInt( this.parent.field3.rawvalue ) ;

  • Calculate length of a string

    Hello.
    I have written a function to calculate the length of a string, it gives the wrong length can you help me fix the codes?
    public int GetStringLength(String z)
    int y = 1;
    int x = 0;
    while (1 > 0)
    try
    char m = z.charAt(y);
    x = x + 1;
    y = y + 1;
    catch (Exception fini)
    return x;
    }

    Hello.
    I have written a function to calculate the length of
    a string, it gives the wrong length can you help me
    fix the codes?
    public int GetStringLength(String z)
    int y = 1;
    int x = 0;
    while (1 > 0)
    try
    char m = z.charAt(y);
    x = x + 1;
    y = y + 1;
    catch (Exception fini)
    return x;
    }Now that's what I call scratching ones belly by wrapping one's arm around one's backside until reaching the belly.

  • How to find out whether the String contains chinese characters

    I need to check if the string contains chinese characters in Java. Does anyone know how to do it? thx.

    Since Java strings contain UNICODE code points, check the content against the relevant page here - http://www.unicode.org/charts/ .

  • How can I find out  the strings that will be presented to the UI

    Hi All,
    I am working on a Swing based application (Swing based UI)
    I am requested to do the following on the bytecode of that application:
    I am supposed to find out what strings from within that bytecode will be presented to the UI and what will be used for an internal usage.
    i have no way of running the application to verify that, i can only work on the static bytecode files.
    hard question ha?
    Thanks,
    EItan.

    You would of course have to run it. Either via a VM or recreating a VM yourself.
    As an example of that how would you figure out what string occurs in the following (pseudo) code?
    String msg = (cnt > 1) ? ("files=" + cnt) : ("file=" + cnt);
    if (cnt > 1) DisplayMessage(msg);

  • How to identify end of the string is ABAP

    Hi friends,
         While I am doing an operation on a string, I want to identify the end of the string. In C we have <b>\0</b>. But in SAP how can we identify that we have reached the end of the string.
    Sathish Reddy.

    use this function and get there 1st character
    CALL FUNCTION 'STRING_REVERSE'
         EXPORTING
              STRING    = ZFNAME
              LANG      = SY-LANGU
         IMPORTING
              RSTRING   = ZFNAME
         EXCEPTIONS
              TOO_SMALL = 1
              OTHERS    = 2.
    IF SY-SUBRC EQ 0.
      WRITE:/ ZFNAME.
    ELSE.
      WRITE:/ 'ERROR REVERSING STRING'.
    ENDIF.

  • SSRS - How to calculate porcent on the same fields

    Hi,
    I have a problem with my Report 
    I have a table like this:
    Description | Mounth
    [Description] | Sum(Valeur
    Pourcent | WHAT I NEED
    When i execute this on my web portal, i have this result:
    Description | January | February | March ...
    Desc 1        | 400       |   500       |   700 ...
    Desc 2        | 325      |   452        | 658
    Porcent       |              |                |
    I don't now how to calculate %. 
    For January i want to do 474/413, for february 1534/1457.
    But i dont know what i need to do in my tablix, in the cell "[WHAT I NEED]" to do this...
    Can you help me.
    SOrry for my bad english.
    Thanks for your help.
    Flo

    Hi sbenett,
    According to your description, you have  two rows in your matrix. Now you want the value in the second row divide the value in the first row. Right?
    In this scenario, since you only have tow rows in your matrix, we just need use the last value divide the previous values in the column group. So we can insert a row outside of group (row group), try the following expression in the cell: =last(Fields!column.Value)/first(Fields!column.Value)
    We have test this scenario in our local environment. Here are screenshots for your reference:
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How to handle comma in the string

    I need compare a string in HTMLDB report, as
    Select HOST, MODEL
    From hwrpt
    WHERE MODEL= :P3_MODEL
    Since most IBM models has 'IBM, XXXX-YYY' syntax for P3:_MODEL, the query failed. I tried to use single/double quoe but failed too.
    Is there a function/syntex I can use to handle comma in the string?

    You need no special quoting because there is a comma in the text string. I was able to do the following:
    1) Created a table named HWRPT with columns HOST and MODEL.
    2) Inserted one record with the value of IBM, XXXX-YYY in the model column.
    3) I created an unconditional branch back to page 2. I created a SQL Report region with the following Select: Select HOST, MODEL From hwrpt
    4) Created a Text item P2_MODEL on page 2.
    5) Added the following text to the SELECT statement for the report region: where model = :p2_model
    6) Ran the page and put IBM, XXXX-YYY in P2_MODEL and pressed the ENTER key.
    7) The row was displayed.

  • How to calculate Length of service for an employee

    Hi All,
    I need to calculate Length of Service for an Employee in PA.
    Is there any Function Module for that?
    Thanks and Regards
    Partha.

    Here is what we use in our reports...
        CALL FUNCTION 'COMPUTE_SEARVIS_YEARS_J'
          EXPORTING
            first_date                  = start_date
            second_date                 = end_date
          IMPORTING
            years_between_dates         = llength_service
          EXCEPTIONS
            sequence_of_dates_not_valid = 1
            OTHERS                      = 2.

Maybe you are looking for

  • Want to you ethernet for migration assistant?

    I would like to use the simple ethernet connection between my Imac Intel and new Macbook Pro. I see in the user's guide that it is possible, but when I opened migration assistant on the new Macbook Pro there was only the Firewire option. I don't have

  • Third-party keyboard caused error when shifting in iMessage

    I Just upgraded to iPhone 6 plus and immediately install the 8.0.2. When using iMessage, the third-party keyboard caused an error when shifting between keyboards as in the picture. The selection animation was shifted to the left beyond the screen. Th

  • Search for ical years

    How do I search previous years w/out clicking on the back or forward arrows to get to the desired year?

  • Qosmio X70-A-K2S - How do I get to the BIOS menu?

    Hello! I have a laptop Qosmio X70-A-K2S. I want to replace one of the hard drives on the SSD. How do I get to the BIOS menu? Recommendations from the user manual (reboot and release F2 for 1 sec.) do not help. I can not get any BIOS menu or BOOT menu

  • Running a script with comments in it

    Hello everybody. I have a script file that has multi-line comments embraced within /* and */. When I fetch it into the sql-buffer using the GET command and run it, it is giving me an error. I'm providing the details of my query. This is my script fil