Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

akuttler
Contributor

Create Concat Field

Hello,

In the data load editor...how do I add a new field that concatenates three other existing fields?

Load script below:

Patient_Ledger_2017:

LOAD

    ENCID,

    ITEMTYPE,

    "Transaction Date",

     "Transaction Time",

     "Service Date"

    Trans,

    CPT,

    UNITS,

    PracticeName,

    LocationName,

    RenderingPhysician,

    BillingProvider,

    "Encounter Total Charges",

    PATIENTID

FROM [lib://BACKUP/PTLEDGER_2017.csv]

(txt, utf8, embedded labels, delimiter is ',', msq);

I want to load an additional field that concatenates "Service Date", RenderingPhysician, and PATIENTID for each row.

Tags (2)
1 Solution

Accepted Solutions

Re: Create Concat Field

May be this

Patient_Ledger_2017:

LOAD

    ENCID,

    ITEMTYPE,

    "Transaction Date",

     "Transaction Time",

     "Service Date"

    Trans,

    CPT,

    UNITS,

    PracticeName,

    LocationName,

    RenderingPhysician,

    BillingProvider,

    "Encounter Total Charges",

    PATIENTID,

   "Service Date" & RenderingPhysician & PATIENTID as New_Fields

FROM [lib://BACKUP/PTLEDGER_2017.csv]

(txt, utf8, embedded labels, delimiter is ',', msq);

6 Replies

Re: Create Concat Field

May be this

Patient_Ledger_2017:

LOAD

    ENCID,

    ITEMTYPE,

    "Transaction Date",

     "Transaction Time",

     "Service Date"

    Trans,

    CPT,

    UNITS,

    PracticeName,

    LocationName,

    RenderingPhysician,

    BillingProvider,

    "Encounter Total Charges",

    PATIENTID,

   "Service Date" & RenderingPhysician & PATIENTID as New_Fields

FROM [lib://BACKUP/PTLEDGER_2017.csv]

(txt, utf8, embedded labels, delimiter is ',', msq);

mdmukramali
Valued Contributor II

Re: Create Concat Field

Hi,

try in your script

"Service Date"&'-'&RenderingPhysician&'-'&PATIENTID as NewFiled.


MVP
MVP

Re: Create Concat Field

You add an extra line before the FROM clause:

"Service Date & RenderingPhysician & PATIENTID AS NewField,


Often you want to add some separator between the concatenated values:


"Service Date" & ' ' & RenderingPhysician & ' ' & PATIENTID AS NewField,


akuttler
Contributor

Re: Create Concat Field

Thank you they all work.

Re: Create Concat Field

Good one can you close the thread now with appropriate answers for the responses.

Re: Create Concat Field

Another and good way also by using Dash for field separators

"Service Date" & '- ' & RenderingPhysician & '-' & PATIENTID AS NewField

Community Browser