Visão geral
Abra o Editor da carga de dados e adicione o script de carregamento a seguir a uma nova seção.
O script de carregamento contém o texto de várias correspondências corporativas que foram enviadas aos funcionários de uma organização. Os dados já foram limpos de qualquer informação pessoal identificável (PII), exceto o nome da empresa e o endereço de e-mail que enviou cada correspondência. O corpo de cada mensagem foi reduzido em uma única string contínua. Em outras palavras, todos os caracteres de formatação e de nova linha foram removidos.
Nossos requisitos:
-
Identifique quais mensagens contêm uma string que inclui o endereço de e-mail TestCompanyNameCorrespondence@test.com, juntamente com uma introdução específica a esse endereço que indica que ele foi o remetente.
-
Queremos flexibilidade sobre quais introduções identificar, mas também manter algumas restrições definidas. As introduções Sender e Sent by são ambas consideradas válidas. Para atingir esse objetivo, podem ser usados padrões regex.
-
A capitalização dos endereços de e-mail não é um fator. Portanto, a pesquisa não deve diferenciar maiúsculas de minúsculas.
Script de carregamento
Correspondences:
Load * Inline [
ID|MessageBody
1|Sent by-- TestCompanyNameCorrespondence@test.com Good morning TestCompanyName team! I hope you are all well. I am just reaching out about the fabulous benefits package we launched just year. Our goal is to take a poll of what you all think. Can you please rate the new options from 1-10 in a response to this email, by this Tuesday? Thank you!
2|Sender: TestCompanyNameIT@test.com Did you know you can access our IT portal anytime, from any of your company devices? It's true! Reach out to your team lead to learn more.
3|Sender: TESTCOMPANYNAMECORRESPONDENCE@test.COM URGENT: This is a message to inform employees of an ongoing issue with our local branch. The branch will be closed until further notice. Thank you
4|Sender: TestCompanyNameVolunteering@test.com Dear team! We are looking for volunteers to help with this year's charity event! We need 40 volunteers to help with the event. If you are interested, please send an email to your direct supervisor. Thanks, TestCompanyName team members, for helping make the world a better place!
5|Sender is TestCompanyNameCorrespondence@test.com Hi folks, it's time to announce the annual TestCompanyName staff party! The party will be taking place at the office this year. Please make sure to RSVP, and we hope to see you there! Sincerely, the TestCompanyName management team
] (delimiter is |);
Resultados
Carregue os dados e abra uma pasta. Crie uma nova tabela e adicione esses campos como dimensões:
Adicione a seguinte medida:
=CountRegExI(MessageBody,'(Sender.*TestCompanyNameCorrespondence@test.com)|(Sent by.*TestCompanyNameCorrespondence@test.com)')
Nas propriedades de medida, defina a função Totais como Sum. Isso configura a linha de totais na parte superior da tabela para contar o número total de registros que contribuem para a contagem.
A medida conta o número de correspondências para o padrão regex especificado no conteúdo da mensagem. No padrão regex, .* indica qualquer número de qualquer caractere, exceto caracteres de nova linha. O padrão também leva em conta a variação na forma como o endereço de e-mail é introduzido: tanto Sender quanto Sent by são correspondências válidas. A variante CountRegExI() da função garante pesquisas sem distinção entre maiúsculas e minúsculas.
Tabela de resultadosTotals | - | 3 |
1 | Sent by-- TestCompanyNameCorrespondence@test.com Good morning TestCompanyName team! I hope you are all well. I am just reaching out about the fabulous benefits package we launched just year. Our goal is to take a poll of what you all think. Can you please rate the new options from 1-10 in a response to this email, by this Tuesday? Thank you! | 1 |
2 | Sender: TestCompanyNameIT@test.com Did you know you can access our IT portal anytime, from any of your company devices? It's true! Reach out to your team lead to learn more. | 0 |
3 | Sender: TESTCOMPANYNAMECORRESPONDENCE@TEST.COM URGENT: This is a message to inform employees of an ongoing issue with our local branch. The branch will be closed until further notice. Thank you | 1 |
4 | Sender: TestCompanyNameVolunteering@test.com Dear team! We are looking for volunteers to help with this year's charity event! We need 40 volunteers to help with the event. If you are interested, please send an email to your direct supervisor. Thanks, TestCompanyName team members, for helping make the world a better place! | 0 |
5 | Sender is TestCompanyNameCorrespondence@test.com Hi folks, it's time to announce the annual TestCompanyName staff party! The party will be taking place at the office this year. Please make sure to RSVP, and we hope to see you there! Sincerely, the TestCompanyName management team | 1 |
Entre as cinco mensagens, há três que correspondem ao padrão regex especificado. Cada mensagem contém uma correspondência.
Nota informativaA função MatchRegEx() também é útil para esses tipos de casos de uso de validação.