• wendy elizabeth (11/1/2013)


    In an SSRS 2008 existing report, I have one column that I need to separate the values. I am not allowed to change the database. I am told that I need to work with the data as it is.

    The values in the column look like the following

    099 11-12 Midwest Plumbers.

    I need to split the data to look like

    1. 099 is the Customer Number.

    2. 11-12 is the year the customer data was valid.

    3. Midwest Plumbers is the name of the company.

    Notes:

    1. The delimiter between the 3 fields is " " (one space).

    2. The company name can contain lots of spaces.

    3. There are 3 fields that need to be separated out which are:

    a. Customer Number,

    b. Effective Years,

    c. Customer Name.

    I 'best' solution, I have so far is:

    =Mid(Parameters!pCust.Value,InStr(Parameters!pCust.Value," ") + 1,Len(Parameters!pCust.Value)-Instr(Parameters!pCust.Value," ")).

    However the above only gets me the first value.

    Thus can you show me how to split up the in this column within SSRS?

    Hi,

    Try the split function

    a. Customer Number,

    =(Split(Parameters!pCust.Value," ")).GetValue(0)

    b. Effective Years,

    =(Split(Parameters!pCust.Value," ")).GetValue(1)

    c. Customer Name.

    =Trim(Replace(Replace(Parameters!pCust.Value,(Split(Parameters!pCust.Value," ")).GetValue(0)," "), (Split(Parameters!pCust.Value," ")).GetValue(1), " " ))

    edit: changed fields to parameters