split function in SSRS

  • =Splt(Fields!Address.Value,",",-1)

    when im exacuting above statement in SSRS it is giving following error

    #Error

    Give me the solution

  • First, there seems to be a typo; 'Split' is the correct spelling and not 'Splt'.

    Second, You can not use a Split directly to put as a value.

    What it does, it splits a string into pieces depending upon the character you have specified(in your case a comma)

    So in order to utilize the Split string,you must pass the index to get the split string at that place e.g.

    =Split(Fields!Address.Value,",")(0).ToString() will return the 1st value OR

    =Split(Fields!Address.Value,",")(1).ToString() will return the second.....

  • Try this

    Fields!Address.Value.ToString().Split(":")(0) 🙂

  • Round brackets and no square brackets should be used. If you want the first occurence of the array use:

    =Split(Fields!Recurrence_Pattern.Value.ToString(),",")(0)

    As you alwasy need to ask question and wait others' answer, I think maybe you can have a try of RAQ Report. It is free and you can get detailed user manual in the installation directory.

    The explanation of the split function of it is shown below:

    Syntax:

    split( srcExp,sepExp{,boolExp})

    Argument:

    srcExp The string to be split.

    sepExp The separator.

    boolExp The parameter option which decides whether to split with the separator between two quotation marks, or brackets. True means to split, while false means not. The default value is false.

    Examples:

    (1) =split(”ab;cd;ef;tg;tt”,”;”) The return value is ["ab","cd","ef","tg","tt"].

    (2) =split(”ab;c’d;e’f;tg;tt”,”;”,false) The return value is ["ab","c'd;e'f","tg","tt"].

    (3) =split(”ab;c[d;e]f;tg;tt”,”;”,true) The return value is ["ab","c[d","e]f”,”tg”,”tt”].

    If you want, you can get a free edition at http://www.raqsoft.com/download/install-package/.

    I wish this can help.

    Regards,

    becklery.

    RAQ Report: Web-based Excel-like Java reporting tool[/url]

  • satishthota (4/22/2008)


    Give me the solution

    I don't know... maybe it's just me or maybe it's just a language barrier thing but that seems awfully rude in any language.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • =SPLIT(REPLACE(Join(Parameters!PersonStatus.Value,","),"[Student]","[Headcount Person]"),",")

    great solution!

    cheers,

    Ferruccio Guicciardi

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply