Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

create three columns with one field

 

I am trying to create three new columns with just the drug name(Red), and two columns with the NDC(Green) numbers.

There is a variable char# count 

 

Is this possible to do?

 

I have included an excel file with two different sets of data.

Reorder number and drug name are veritable character length.   

 

 

LIB CONNECT TO 'pharmoresql production (pharmore_rwinkel)';

LOAD ID,

     FacID,

    PatID,

     Msg,

      UPPER (ChangedBy) as ChangedBy,

     ChangedOn,

     "Comment";

  QL SELECT ID,

     FacID,

     PatID,

   Msg,

   ChangedBy,

   ChangedOn,

   "Comment"

ROM FwReports.dbo.PatientsLog

ere ChangedOn > '2015-1-1'

  and Upper(Msg) like '% NDC FROM %';

 

1 Solution

Accepted Solutions
aarkay29
Valued Contributor

Re: create three columns with one field

PFA

6 Replies
Not applicable

Re: create three columns with one field

please see above

aarkay29
Valued Contributor

Re: create three columns with one field

PFA

Not applicable

Re: create three columns with one field

I can't load, I use Qlik sense

aarkay29
Valued Contributor

Re: create three columns with one field

Use the below to get the required columns

Load *,

TextBetween(Msg,'(',')') as Supplement,

SubField(SubField(Msg,'NDC from ',2),'"',2) as FromNDC,

TextBetween(SubField(SubField(Msg,'NDC from ',2),'to',2),'"','"') as ToNDC ;

LOAD PatID,

     ChangedOn,

     ChangedBy,

     Msg,

     Comment

From

Table;

Not applicable

Re: create three columns with one field

Thank you vary much.

Do you know of a list of commands/expressions that Qlik uses?

aarkay29
Valued Contributor

Re: create three columns with one field