Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Pessoal,
Sou novo aqui e no uso do Qlikview. Agradeço a ajuda antecipadamente.
Tenho uma tabela com as colunas abaixo:
RegID | Data | Telefone | Tráfego |
---|---|---|---|
1 | 1/7/2018 | 21 911111111 | 2000 |
2 | 1/7/2018 | 21 911111111 | 3000 |
3 | 2/7/2018 | 21 911111111 | 4000 |
4 | 1/72018 | 21 92222222 | 3000 |
5 | 1/7/2018 | 21 92222222 | 4000 |
6 | 2/7/2018 | 21 92222222 | 2000 |
7 | 3/7/2018 | 21 92222222 | 3000 |
8 | 4/7/2018 | 21 93333333 | 2000 |
Preciso gerar uma analise que consolide o tráfego por telefone por dia com uma coluna que indique a quantidade de registros agregados como o exemplo abaixo:
Data | Telefone | Tráfego total | # RegID |
---|---|---|---|
1/7/2018 | 21 911111111 | 5000 | 2 |
1/7/2018 | 21 92222222 | 7000 | 2 |
2/7/2018 | 21 911111111 | 4000 | 1 |
Se puder, por favor me respondam com a sugestão de string na mensagem, estou sem a versão adequada para abrir QVWs no meu ambiente.
Att.,
Olá amigo.
Caso eu tenha entendido sua dúvida, segue:
a) Objeto de tabela Pivot;
b) Colunas: Data e Telefone
c) Medidas:
c1) Sum(Tráfego)
c2) Count(DISTINCT RegID)
Com a tabela Pivot ele já vai agregar automaticamente suas dimensões.
Caso a necessidade for agrupar dentro da tabela linear e fizer questão do Aggr() por algum motivo em particular, então:
a) Objeto de tabela Linear;
b) Colunas: Data e Telefone
c) Medidas:
c1) Sum(Aggr(Sum(Tráfego), Data, Telefone))
c2) Count(Aggr(Count(DISTINCT RegID), Data, Telefone))
Olá Luis,
Veja os resultados das suas sugestões:
1) Pivot Table
Data | MSISDN | =Sum(GGSN_Tráfego) | =Count(DISTINCT RegID) |
21/07/2018 | 21995677753 | 300 | 1 |
21/07/2018 | 21995677753 | 310 | 1 |
21/07/2018 | 21997186622 | 280 | 1 |
21/07/2018 | 21997186622 | 280 | 1 |
21/07/2018 | 21997186622 | 280 | 1 |
2) Tabela Linear
Data | MSISDN | = Sum(Aggr(Sum(GGSN_Tráfego), Data, MSISDN)) | =Count(Aggr(Count(DISTINCT RegID), Data, MSISDN)) |
890 | 3 | ||
21/07/2018 | 21995677753 | 300 | 1 |
21/07/2018 | 21995677753 | 310 | 1 |
21/07/2018 | 21997186622 | 280 | 1 |
21/07/2018 | 21997186622 | 280 | 1 |
21/07/2018 | 21997186622 | 280 | 1 |
O que espero de resultado:
Data | MSISDN | Tráego TOTAL | # RegID |
21/07/2018 | 21995677753 | 610 | 2 |
21/07/2018 | 21997186622 | 840 | 3 |
Agradeço a ajuda.
Att.,
Você pode compartilhar sua aplicação para análise?
É muito grande. Desculpe
Segue um exemplo:
Possivelmente eu tenha entendido algo diferente do que você espera, faça o Count() sem o uso de "distinct".