Reg: Data shift from one column to another

General

Reg: Data shift from one column to another

Hello all....

I am a adhoc user of a teradata where we are extracting data using the below query into a text file and then open that data in an excl sheet and work on the data. Here when we open it in excel some of the columns data is being shifted into other columns..as shown in the below screen shot.

I have planed to check it directely in the txt file but due to huge columns adn data am not able to check it .....

So would like to know if the problem is from TD or due to opening the data in excel sheet.

QUERY :

--SK_CID_EMEA_EXCEP_CODE_DPS_Segment(with_SVC_Tag)

SELECT mdoe_50533."DPS_NUM" AS "Dps Num: rc"

,ch_2414."TYPE_DESC" AS "Channel Type Desc"

,soic_50576."COMMODITY_DESC" AS "Commodity Desc: sipe ic"

,ph_72."PRODUCT_DESC" AS "Product Desc"

,mdoe_50533."CREATE_WEEK_NUM" AS "Create Week Num: mdoe"

,rch_219."BUSINESS_UNIT_ID" AS "Business Unit ID"

,rch_219."LOCAL_CHANNEL" AS "Local Channel"

,ph_72."External_Rptg" AS "External Rptg LOB"

,ph_72."GROUP_DESC" AS "Group Desc"

,icn_1565."COUNTRY_NUM_DESC" AS "Svc Country Num Desc"

,sbu_50626."SUB_REGION_DESC" AS "Svc Sub Region Desc: sb"

,oobuc_50669."SUB_REGION_DESC" AS "Orig Order Sub Region Desc"

,mdoe_50533."SERVICE_LEVEL_CODE" AS "Service Level Code"

,slcfsde_50538."SERVICE_DECODE_TEXT" AS "Service Level Description"

,sde_50682."SERVICE_DECODE_TEXT" AS "DPS Type Desc:mdoe"

,esche_50627."ESC_HIST_EXCEPTION_CODE" AS "Exception Code: esch"

,mdoe_50533."SVC_INCDNT_CREATE_DATE_DT" AS "Svc Incdnt Create Date Only: m"

,ibate_50545."TECH_CODE" AS "Tech Code"

,ibate_50545."TECH_NAME" AS "Tech Name"

,mdoe_50533."SVC_INCDNT_REASON" AS "Reason Code"

,rcfsde_50537."SERVICE_DECODE_TEXT" AS "Reason Code Description"

,de_50578."SHORT_DSP_CODE" AS "Short Dsp Code: dsp"

,pde_50579."PARENT_NAME" AS "Parent Name: pde"

,mdoe_50533."EXT_SERVICE_CALL_CLOSE_DATE_DT" AS "Ext Service Call Close Date On"

,mdoe_50533."CLOSE_WEEK_NUM" AS "External Close Week Num: mdoe"

,mdhe_50535."EXT_SERVICE_EXCEPTION_CODE" AS "Ext Service Exception Code: md"

,mdoe_50533."SERVICE_TAG_NUM" AS "Service Tag Num: mdoe"

,ch_2414."CUST_TYPE_DESC" AS "Cust Type Desc"

,sipe_50534."QTY_BOOKED" AS "Qty Booked: sipe"

,pe_50575."PART_COST" AS "Part Cost: sipe pe"

,sipe_50534."PART_NUM"

,per.assoc_bdge_nbr AS "Tech Support Badge"

,per.ASSOC_FULL_NM AS "Tech Support Name"

,per.bus_rptg_queue_nm AS "Tech Support Queue Name"

,per.assoc_loc_nm AS "Tech Support Location Name"

,bus_frst_mgr_bdge_nbr AS "Tech Support Manager Badge"

,bus_frst_mgr_Frst_nm ||' '||bus_frst_mgr_last_nm  AS "Tech Support Manager Name"

FROM EURO_SVC_MART.MERGE_DSP_OTF_EURO mdoe_50533

INNER JOIN corp_ww.INTERNAL_COUNTRY_NUM icn_1565 ON

(

mdoe_50533."SVC_BUS_COUNTRY_NUMBER"=icn_1565."COUNTRY_NUMBER")

INNER JOIN EURO_SVC.DSP_EURO de_50578 ON

(

mdoe_50533."DSP_CODE"=de_50578."DSP_CODE")

LEFT OUTER JOIN EURO_UMLT.PARENT_DSP_EURO pde_50579 ON

(

de_50578."PARENT_DSP_CODE"=pde_50579."PARENT_DSP_CODE")

INNER JOIN EURO_SVC.SVC_DECODE_EURO rcfsde_50537 ON

(

'RSN'=rcfsde_50537."SERVICE_DECODE_TYPE" AND mdoe_50533."SVC_INCDNT_REASON"=rcfsde_50537."SERVICE_DECODE_CODE")

LEFT OUTER JOIN CORP_DRM_PKG.CHNL_HIER ch_2414 ON

(

mdoe_50533."ORIG_LOCAL_CHANNEL"=ch_2414."LCL_CHNL_CODE" AND mdoe_50533."ORIG_CUSTOMER_BUSINESS_UNIT_ID"=ch_2414."BU_ID")

LEFT OUTER JOIN EURO_SVC_MART.SVC_INC_PART_EURO sipe_50534 ON

(

mdoe_50533."DPS_NUM"=sipe_50534."DPS_NUM")

LEFT OUTER JOIN CORP_WW.REGIONAL_CHANNEL_INFO rch_219 ON

(

mdoe_50533."ORIG_LOCAL_CHANNEL"=rch_219."LOCAL_CHANNEL" AND mdoe_50533."ORIG_CUSTOMER_BUSINESS_UNIT_ID"=rch_219."BUSINESS_UNIT_ID")

LEFT OUTER JOIN EURO_UMLT.TECH_EURO ibate_50545 ON

(

mdoe_50533."SVC_INCDNT_ISSUED_BY"=ibate_50545."TECH_CODE")

LEFT OUTER JOIN CORP_WW.BUSINESS_UNIT_INFO oobuc_50669 ON

(

mdoe_50533."ORIG_ORDER_BUSINESS_UNIT_ID"=oobuc_50669."BUSINESS_UNIT_ID")

LEFT OUTER JOIN CORP_WW.PRODUCT_HIERARCHIES ph_72 ON

(

mdoe_50533."SYSTEM_CLASS"=ph_72."SKU_CLASS")

LEFT OUTER JOIN euro_svc.EXT_SVC_CALL_HIST_EURO esche_50627 ON

(

mdoe_50533."DPS_NUM"=esche_50627."DPS_NUM")

INNER JOIN CORP_WW.BUSINESS_UNIT_INFO sbu_50626 ON

(

mdoe_50533."SVC_BUSINESS_UNIT_ID"=sbu_50626."BUSINESS_UNIT_ID")

LEFT OUTER JOIN EURO_SVC.SVC_DECODE_EURO sde_50682 ON

(

'SVC'=sde_50682."SERVICE_DECODE_TYPE" AND mdoe_50533."DPS_TYPE"=sde_50682."SERVICE_DECODE_CODE")

INNER JOIN EURO_SVC_MART.MERGE_DSP_HIST_EURO            mdhe_50535 ON

(

mdoe_50533."DPS_NUM"=mdhe_50535."DPS_NUM")

LEFT OUTER JOIN SVC_MART.ITEM_COMMODITY soic_50576 ON

(

sipe_50534."PART_NUM"=soic_50576."ITEM_NUM")

LEFT OUTER JOIN EURO_FIN_MART.PART_EURO pe_50575 ON

(

sipe_50534."PART_NUM"=pe_50575."PART_NUM" AND sipe_50534."ORIG_order_BUSINESS_UNIT_ID"=pe_50575."BUSINESS_UNIT_ID")

INNER JOIN EURO_SVC.SVC_DECODE_EURO slcfsde_50538 ON

(

mdoe_50533."SERVICE_LEVEL_CODE"=slcfsde_50538."SERVICE_DECODE_CODE" AND 'SVL'=slcfsde_50538."SERVICE_DECODE_TYPE")

inner join

svc_pkg.GBL_SVC_DSPCH_FACT DPS

on

mdoe_50533."DPS_NUM"=DPS.SVC_DSPCH_ID

LEFT OUTER JOIN PARTY_PKG.ASSOC_DIM per ON  DPS.ASSOC_BDGE_NBR = per.ASSOC_BDGE_NBR AND CAST(DPS.DSPCH_CRT_DTS AS DATE) BETWEEN per.src_eff_strt_dt and per.src_eff_end_dt

WHERE ((esche_50627."ESC_HIST_EXCEPTION_CODE" IN ('CDR', 'CDN')

 OR

mdhe_50535."EXT_SERVICE_EXCEPTION_CODE" IN ('CDR', 'CDN')

)

and mdoe_50533."SVC_INCDNT_CREATE_DATE_DT" BETWEEN '2012-02-02' AND '2014-01-31'

)

GROUP BY mdoe_50533."DPS_NUM"

,ch_2414."TYPE_DESC"

,soic_50576."COMMODITY_DESC"

,ph_72."PRODUCT_DESC"

,mdoe_50533."CREATE_WEEK_NUM"

,rch_219."BUSINESS_UNIT_ID"

,rch_219."LOCAL_CHANNEL"

,ph_72."External_Rptg"

,ph_72."GROUP_DESC"

,icn_1565."COUNTRY_NUM_DESC"

,sbu_50626."SUB_REGION_DESC"

,oobuc_50669."SUB_REGION_DESC"

,mdoe_50533."SERVICE_LEVEL_CODE"

,slcfsde_50538."SERVICE_DECODE_TEXT"

,sde_50682."SERVICE_DECODE_TEXT"

,esche_50627."ESC_HIST_EXCEPTION_CODE"

,mdoe_50533."SVC_INCDNT_CREATE_DATE_DT"

,ibate_50545."TECH_CODE"

,ibate_50545."TECH_NAME"

,mdoe_50533."SVC_INCDNT_REASON"

,rcfsde_50537."SERVICE_DECODE_TEXT"

,de_50578."SHORT_DSP_CODE"

,pde_50579."PARENT_NAME"

,mdoe_50533."EXT_SERVICE_CALL_CLOSE_DATE_DT"

,mdoe_50533."CLOSE_WEEK_NUM"

,mdhe_50535."EXT_SERVICE_EXCEPTION_CODE"

,mdoe_50533."SERVICE_TAG_NUM"

,ch_2414."CUST_TYPE_DESC"

,sipe_50534."QTY_BOOKED"

,pe_50575."PART_COST"

,sipe_50534."PART_NUM"

,per.assoc_bdge_nbr

,per.ASSOC_FULL_NM

,per.bus_rptg_queue_nm

,per.assoc_loc_nm

,bus_frst_mgr_bdge_nbr

,bus_frst_mgr_Frst_nm ||' '||bus_frst_mgr_last_nm

Error Screen shot:

can see here, there is no column name but some data available in that column....

can see here column "Tech_Support_ManagerName"  which should contain character data but it also showing numbers which belongs to its preceding colunm "Tech_Support_ManagerBridge"

2 REPLIES

Re: Reg: Data shift from one column to another

Are you importing to Excel using comma separated values? I've seen this happen when commas are used as the column separator and exist in the data.  You can try changing your column separator to something like "~|", scarcely used printer marks.

Re: Reg: Data shift from one column to another

Hey thanks for your early responce ....

I am using <tab>  separator when am  extraction data from TD into text file. Do you want me to change the delimiter to some other while importing from TD or while importing from txt to EXCEL sheet...