none
Split one field into many with delimiter RRS feed

  • Question

  • Hello,

    I have a table named SpecInstruction. Below is an example.

    I need to split the PickSpclInsrtDescription field in separate fields using the hyphen as a delimiter. At the most, I will have no more than five fields once it has been split. Below is an example of what I want to achieve.

    Thank you in advance for your help.

    Friday, November 11, 2016 3:32 PM

Answers

  • I found this code that seems to work for me.

    Public Function ParseText(TextIn As String, X) As Variant
    On Error Resume Next
    Dim VAR As Variant
    VAR = Split(TextIn, "-", -1)
    ParseText = VAR(X)
    End Function

    The I call it from my query:

    Logo1: ParseText([QlikSense WIP-WIP Emb link]![PickSpclInstrDescription],0)

    Logo2: ParseText([QlikSense WIP-WIP Emb link]![PickSpclInstrDescription],1)

    Logo3: ParseText([QlikSense WIP-WIP Emb link]![PickSpclInstrDescription],2)

    • Marked as answer by KevinATF Friday, November 11, 2016 4:46 PM
    Friday, November 11, 2016 4:46 PM