Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Sarath123
Contributor III
Contributor III

How to get a new table with only required rows from old table with huge data

Hello,

I have a sheet of data with 17776 rows. But I need only rows which has the code 
110,1170,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1230,1250,1270,1290,1301,131,130270,1306,1390,153,156,157,158,159,160,1541,1542,1543,1544,1545,1546,1530,1547,1550,15500140,1570,1590,15904001,2101,2102,2103,2104,2107,2109,2301,2302,2309,2602,2603,2604,2609,2801,2901,3101,31010160,32010160,3201,31010107,32010107,4101,4201,4202,4203,4204,4209,11700101,1547,1550,1590,15904001,3101,3201,15500140,15500240,15904001,15904002,15904003,15904001,50904002,50904003,31010140,31010160,31010107
Hardly these are  91 rows + nine quarter sales for each code so totally 819 rows.
Can we create a new table with only these above codes to reduce the time complexity during loading of data
Looking for a solution on this case!!

1 Solution

Accepted Solutions
StarinieriG
Partner - Specialist
Partner - Specialist

NoConcatenate

Austria:
LOAD 
Code,
TU_Company_QTR,
TU_Total_QTR,

FROM
[C:\Users\Desktop\book4.xlsx]
(ooxml, embedded labels, table is Sheet1)

where match(Code,'1201','1202','1203');

STORE Austria into [C:\Users\Desktop\New_AUSTRIA.csv];

View solution in original post

8 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

have you tried to add a where condition?

Sarath123
Contributor III
Contributor III
Author

load *

resident [Austria]

where match(code,'1201','1202','1203');
STORE * from Austria into [M:user:New_AUSTRIA.csv];

I tried like the above but the new sheet is showing all the codes

StarinieriG
Partner - Specialist
Partner - Specialist

Try to use 

STORE Austria into [M:user:New_AUSTRIA.csv];

without "* from"

StarinieriG
Partner - Specialist
Partner - Specialist

If you do a simple resident *, you have to rename table and use noconcatenate, so you are sure that tables are not automatically concatenate

Sarath123
Contributor III
Contributor III
Author

I wrote the script with your answer But it is not working .Let me provide you the script

Austria:
LOAD 
Code,
TU_Company_QTR,
TU_Total_QTR,

FROM
[C:\Users\Desktop\book4.xlsx]
(ooxml, embedded labels, table is Sheet1);

NoConcatenate
load *
resident [Austria]
where match(Code,'1201','1202','1203');
STORE Austria into [C:\Users\Desktop\New_AUSTRIA.csv];
EXIT SCRIPT

Can you check my script and let me know the correction
If I can write for 3 codes, I will try to write for 91 codes as well

StarinieriG
Partner - Specialist
Partner - Specialist

NoConcatenate

Austria:
LOAD 
Code,
TU_Company_QTR,
TU_Total_QTR,

FROM
[C:\Users\Desktop\book4.xlsx]
(ooxml, embedded labels, table is Sheet1)

where match(Code,'1201','1202','1203');

STORE Austria into [C:\Users\Desktop\New_AUSTRIA.csv];

Sarath123
Contributor III
Contributor III
Author

It is working Now
Thank you so much for your help

Sarath123
Contributor III
Contributor III
Author

I have created new excel sheet with only required columns and I did my calculations which are needed to calculated the sales for both Company and total sales.
But I am getting multiple fileds on the table with the nrmal sum of sales and calculated sales 
e.g; 
code         companysales         Total sales

1530               5000                       -200000    ----This is the sum of sales code(1530)-code(XXXXX)-code(XXXX)

1530          100000                         400000     ----This is sum of sales with the code(1530)

But I need only the first row with calcualted values that should contain in the table .Any suggestion how can I get first row