Add more patterns for language extraction
This commit is contained in:
parent
bc7acf150f
commit
2e068f0859
@ -14,8 +14,14 @@ with LANGS as (
|
|||||||
AGENT_NAME,
|
AGENT_NAME,
|
||||||
AGENT_GROUP,
|
AGENT_GROUP,
|
||||||
case
|
case
|
||||||
when strpos(AGENT_NAME, '--') > 0
|
when strpos(AGENT_NAME, '-- ') > 0
|
||||||
then substr(AGENT_NAME, strpos(AGENT_NAME, '--') + 3)
|
then substr(AGENT_NAME, strpos(AGENT_NAME, '--') + 3)
|
||||||
|
when strpos(AGENT_NAME, '--') > 0
|
||||||
|
then substr(AGENT_NAME, strpos(AGENT_NAME, '--') + 2)
|
||||||
|
when strpos(AGENT_NAME, '- ') > 0
|
||||||
|
then substr(AGENT_NAME, strpos(AGENT_NAME, '-') + 2)
|
||||||
|
when strpos(AGENT_NAME, '-') > 0
|
||||||
|
then substr(AGENT_NAME, strpos(AGENT_NAME, '-') + 1)
|
||||||
else null
|
else null
|
||||||
end AS LANGUAGES
|
end AS LANGUAGES
|
||||||
from ${ref("stg_digital")}
|
from ${ref("stg_digital")}
|
||||||
@ -24,8 +30,14 @@ with LANGS as (
|
|||||||
AGENT_NAME,
|
AGENT_NAME,
|
||||||
AGENT_GROUP,
|
AGENT_GROUP,
|
||||||
case
|
case
|
||||||
when strpos(AGENT_NAME, '--') > 0
|
when strpos(AGENT_NAME, '-- ') > 0
|
||||||
then substr(AGENT_NAME, strpos(AGENT_NAME, '--') + 3)
|
then substr(AGENT_NAME, strpos(AGENT_NAME, '--') + 3)
|
||||||
|
when strpos(AGENT_NAME, '--') > 0
|
||||||
|
then substr(AGENT_NAME, strpos(AGENT_NAME, '--') + 2)
|
||||||
|
when strpos(AGENT_NAME, '- ') > 0
|
||||||
|
then substr(AGENT_NAME, strpos(AGENT_NAME, '-') + 2)
|
||||||
|
when strpos(AGENT_NAME, '-') > 0
|
||||||
|
then substr(AGENT_NAME, strpos(AGENT_NAME, '-') + 1)
|
||||||
else null
|
else null
|
||||||
end AS LANGUAGES
|
end AS LANGUAGES
|
||||||
from ${ref("stg_calls")})
|
from ${ref("stg_calls")})
|
||||||
@ -41,4 +53,4 @@ from LANGS l
|
|||||||
left join ${ref("stg_MAPPING_AGENT_GROUP")} ag
|
left join ${ref("stg_MAPPING_AGENT_GROUP")} ag
|
||||||
on l.AGENT_GROUP = ag.AGENT_GROUP
|
on l.AGENT_GROUP = ag.AGENT_GROUP
|
||||||
left join ${ref("stg_MAPPING_LANGUAGES")} ml
|
left join ${ref("stg_MAPPING_LANGUAGES")} ml
|
||||||
on l.LANGUAGES = ml.LANGUAGE
|
on upper(l.LANGUAGES) = upper(ml.LANGUAGE)
|
||||||
Loading…
Reference in New Issue
Block a user