Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Specialist
Specialist

6 Replies
Not applicable
Author

please see above

aarkay29
Specialist
Specialist

PFA

Not applicable
Author

I can't load, I use Qlik sense

aarkay29
Specialist
Specialist

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
Author

Thank you vary much.

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