Hello all,
I have different data tables that i created from another tables, In each Data Tables, it contains strings of variable length in the format Character in the same column name. I've added some examples below. I am trying to remove the last 4 characters of the string from the column, and keep everything else. The last 4 characters are always "DATA", . I have tried to accomplish if statement to link different Data tables and using Left(), and Contains() but I think the way i wrote it is wrong. I hope I could get anyone help in this community since I just started to learn jmp jsl.
Ex:
Data Table 1
Source
FARAH_DATA
FARAH_DATA
FARAH_DATA
FARAH_DATA
Data Table 2
Source
MIKE_DATA
MIKE_DATA
MIKE_DATA
This is what I want the each Data Table looks like;
Data Table 1
Source
FARAH
FARAH
FARAH
FARAH
Data Table 2
Source
MIKE
MIKE
MIKE
I have attached my jsl as below
dtList = {};
For( i = 1, i <= N Table(), i++,
tempdt = data table(i)<<get name;
if(contains(eval(tempdt),"Subset"),
insert into(dtList, tempdt ), // to define how many Data table created
);
);
Current Data Table( dtList );
For( i = 1, i <= N Items( dtList ), i++,
dtList: Source [i] = Left( Source, Contains( Source, "DATA") - 2 );