工作问题小结

本文介绍了如何处理包含特殊字符的CSV文件,通过使用记事本或Notepad++进行查找替换操作。同时,讲解了在Excel中利用VLOOKUP函数进行多条件关联分析的方法,用于数据对比。示例代码展示了在大数据场景下,如何进行客户信息的多表联合查询和电话服务次数统计。
摘要由CSDN通过智能技术生成

1,csv文件本质是文本文件,如果csv文件里含有大量的tab符,或者别的不可见字符,可以把文件名后缀.csv直接改成.txt,然后用记事本或者notepad++打开,Ctrl F进行查找,全部替换掉即可。
2,在Excel文件中两张表进行多条件关联时 ,可将条件列进行concat,然后用vlookup函数进行匹配数据进行对比。
vlookup(要查询的值,查询范围(KaTeX parse error: Double superscript at position 557: …KV064D15R' '̲170005863' '_…{v_date}’ – 该表为全量分区表,dt需要固定为最新分区
and cust_serv_mode_cd = ‘1’ – 电话访问
and work_occu_date <= ‘ v d a t e ′ − − 工 作 发 生 日 期 < = 统 计 日 期 a n d s u b s t r ( w o r k o c c u d a t e , 1 , 4 ) = s u b s t r ( ′ {v_date}' -- 工作发生日期 <= 统计日期 and substr(work_occu_date,1,4) = substr(' vdate<=andsubstr(workoccudate,1,4)=substr({v_date}’ ,1,4) – 限制时间范围:本年
) t1 lateral view explode(t1.rela_cust_lsts) table_tmp as cust_no
) t2
group by t2.cust_no ,t2.otbd_cust_calb_id
) a
full join
( – 1.2 客户外呼录音记录:客户本年电话服务次数
select t2.cust_no as cust_no – 通话客户(剔除非正式客户)
,nvl(t1.otbd_cust_calb_id,‘bb’) as otbd_cust_calb_id --外呼客户回调标识
,count(*) as tel_serv_cnt – 电话服务次数
from db_edw.mkt_cust_otbd_srec_recd t1 – 客户外呼录音记录
left join (select cust_no from db_edw.pty_cust where dt = ‘ v d a t e ′ ) t 2 o n t 1. c u s t n o = t 2. c u s t n o w h e r e t 1. d t = ′ {v_date}') t2 on t1.cust_no = t2.cust_no where t1.dt = ' vdate)t2ont1.custno=t2.custnowheret1.dt={v_date}’ – 该表为全量分区表,dt需要固定为最新分区
and t2.cust_no is not null – 客户(剔除非正式客户)
and t1.call_date <= ‘ v d a t e ′ − − 通 话 日 期 < = 统 计 日 期 a n d s u b s t r ( t 1. c a l l d a t e , 1 , 4 ) = s u b s t r ( ′ {v_date}' -- 通话日期<= 统计日期 and substr(t1.call_date,1,4) = substr(' vdate<=andsubstr(t1.calldate,1,4)=substr({v_date}’ ,1,4) – 通话日期=本年
group by t2.cust_no,nvl(t1.otbd_cust_calb_id,‘bb’)
) b
on a.cust_no = b.cust_no and a.otbd_cust_calb_id = b.otbd_cust_calb_id ;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值