Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a script below to pull all the information within the year 2016 for the 3 specific record types from January to December. The data will be pulled from the four (4) different databases at the same time. But it was already 14 hours running and still retrieving the information from the first database.
LIB CONNECT TO 'TOLX';
[Month]:
LOAD
SubField( "xzmt_month", ';' ,1) as 'Total',
xzmt_year,
xzmt_domain,
xzmt_addr,
xzpd_design,
'Jan' as MONTH_SHORTNAME,
xzmt_rec_type
;
SQL SELECT
'Jan',
a.xzmt_month,
a.xzmt_year,
a.xzmt_domain,
a.xzmt_addr,
b.xzpd_design,
a.xzmt_rec_type
FROM
mdlive.PUB.xzmt_mstr a
LEFT JOIN mdlive.PUB.xzpd_mstr b ON a.xzmt_prod_type =b.xzpd_prod_type
LEFT JOIN mdlive.PUB.xzcm_mstr c ON a.xzmt_addr =c.xzcm_addr
LEFT JOIN qaddb.PUB.code_mstr d ON a.xzmt_prod_type =d.code_value
LEFT JOIN qaddb.PUB.so_mstr e ON a.xzmt_addr = e.so_cust
LEFT JOIN qaddb.PUB.ad_mstr i ON a.xzmt_addr = i.ad_addr
WHERE a.xzmt_rec_type IN ('SHPA','ShpE','PURP') and a.xzmt_year = 2016
;
Feb:
LOAD
SubField( "xzmt_month", ';' ,2) as 'Total',
'Feb' as MONTH_SHORTNAME,
xzmt_year,
xzmt_domain,
xzmt_addr,
xzpd_design,
xzmt_rec_type;
SQL SELECT
'Feb',
a.xzmt_month,
a.xzmt_year,
a.xzmt_domain,
a.xzmt_addr,
b.xzpd_design,
a.xzmt_rec_type
FROM
mdlive.PUB.xzmt_mstr a
LEFT JOIN mdlive.PUB.xzpd_mstr b ON a.xzmt_prod_type =b.xzpd_prod_type
LEFT JOIN mdlive.PUB.xzcm_mstr c ON a.xzmt_addr =c.xzcm_addr
LEFT JOIN qaddb.PUB.code_mstr d ON a.xzmt_prod_type =d.code_value
LEFT JOIN qaddb.PUB.so_mstr e ON a.xzmt_addr = e.so_cust
LEFT JOIN qaddb.PUB.ad_mstr i ON a.xzmt_addr = i.ad_addr
WHERE a.xzmt_rec_type IN ('SHPA','ShpE','PURP') and a.xzmt_year = 2016
;
[and then March, April up to Dec]
Please note that below is the original data of the column "xzmt_month" that is why I came up with the script above. I would like to put all the sales in one column (Total) same with the months, in one column (Month) also. Thank you much in advance. ![]()
xzmt_month
| 503;522;740;681;637;674;678;567;535;546;518;467 | ||||
| 527;602;677;662;715;715;715;658;621;564;564;504 | ||||
| 42;47;50;46;46;45;43;41;42;42;39;35 | ||||
| 2;2;2;2;3;3;3;2;2;2;2;2 | ||||
| 459;476;675;621;581;615;618;518;488;499;472;426 | ||||
| 421;480;541;529;571;571;571;526;496;451;451;403 | ||||
| 232;257;277;251;252;246;234;228;233;229;213;190 | ||||
| 1191;1236;1753;1612;1508;1595;1605;1344;1267;1294;1226;1107 | ||||
| 3750;4285;4821;4715;5089;5089;5089;4687;4419;4018;4018;3589 | ||||
| 5649;6272;6757;6113;6141;5995;5718;5558;5683;5579;5199;4644 | ||||
| 235;264;311;289;278;292;280;251;241;236;242;195 | ||||
| 955;992;1406;1293;1210;1280;1286;1076;1015;1036;983;888 | ||||
| 752;859;967;944;1021;1021;1021;940;886;806;806;720 | ||||
| 385;428;461;418;419;409;390;379;388;380;355;317 | ||||
| 34;38;45;41;40;42;40;36;35;34;35;28 | ||||
| 611;634;899;827;774;818;823;689;650;664;629;568 | ||||
| 484;553;622;608;658;657;657;605;570;518;518;463 | ||||
| 121;135;145;131;131;128;122;119;122;119;111;99 | ||||
| 440;457;648;596;558;590;593;497;468;478;453;409 | ||||
| 298;340;383;374;403;404;404;372;351;319;319;285 | ||||
| 133;147;159;144;144;141;135;131;133;131;123;109 | ||||
| 98;101;144;132;124;131;132;110;104;106;101;91 | ||||
| 124;142;160;156;169;169;169;155;147;133;133;119 | ||||
| 63;71;76;69;70;68;64;62;63;62;58;52 | ||||