Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Bom dia, referente ao acumulado encontrei alguns tutorias que ensinam a criar pela expressao RangeSum(Above(SUM(VALOR),0,RowNo())). O que eu preciso fazer é comparar o acumulado com a seguinte tabela:
eu preciso comparar o valor acumulado para verificar se ele atingiu De, se atingiu Ate, verificar em qual nivel esta para saber qual é o valor do incentivo. Os incentivos são em porcentagem. Seria melhor fazer por script ou direto na expressão?
Boa tarde Alessandro, obrigado pelo retorno, estou enviando o modelo somente com as tabelas que preciso utilizar o IntervalMatch.
Bom dia Alessandro, ontem olhando os exemplos que me passou e também os exemplos que o Yuri passou, aparentemente esta correto, mas quando eu faço DROP na tabela, ele zera todas as informações da tabela a qual eu estou fazendo o IntervalMatch, se não faço DROP na tabela ele gera varias chaves sinteticas e quando tento utilizar os filtros não funciona.
Bom dia, fiz algumas alterações no codigo, e agora estou conseguindo utilizar o intervalmatch, mas estava verificando e o valor do acumulado não esta fechando, o valor acumulado via script é diferente do valor acumulado na expressão. Poderiam me ajudar? Estou enviando o qvw para analise. No intervalmatch pensei em utilizar o valor acumulado para que ele verifique os niveis e valor de incentivo.
Boa tarde, consegui criar o intervalmatch, mas percebi que os valores estão sendo triplicados.
TABELA_TOTAIS_FORNECEDOR:
LOAD
ID_EMPRESA_F&'|'&DATA_FORNECEDOR AS CHAVE,
COD_FORN_PRINCIPAL_F,
FORNECEDOR_PRINCPAL,
COD_FORNECEDOR,
FORNECEDOR_F,
PRODUTO_F,
TOTAL_BILHETE_F,
TOTAL_BILHETE_LEIKANDIR_F,
TOTAL_BILHETE_VOARE_F,
TOTAL_TARIFA_F,
TOTAL_TARIFA_PAGA_F,
TOTAL_TARIFA_RETENCAO_F,
TOTAL_TARIFA_VOARE_F,
TOTAL_TAXA_F,
TOTAL_TAXA_PAGA_F,
TOTAL_TAXA_RETENCAO_F,
TOTAL_TAXA_VOARE_F,
TOTAL_RETIDO_TARIFA_F,
TOTAL_RETIDO_TARIFA_VOARE_F,
TOTAL_RETIDO_TAXA_F,
TOTAL_RETIDO_TAXA_VOARE_F,
TOTAL_RETIDO_OUTRAS_TAXAS_F,
TOTAL_RETIDO_TAXA_DU_F,
TOTAL_TAXA_SERVICO_F,
TOTAL_RETIDO_TAXA_SERVICO_F,
TOTAL_TAXA_EXTRA_F,
TOTAL_DESCONTO_F,
TOTAL_VALOR_VENDA_F,
TOTAL_VALOR_PAGAR_F,
TOTAL_VALOR_RECEBER_F,
TOTAL_MARGEM_LUCRO_F,
ACUMULADO,
ULTIMO_REGISTRO_F
// DATA_FORNECEDOR,
// ID_EMPRESA_F
FROM TABELA_TOTAIS_FORNECEDOR.qvd(qvd);
TABELA_SHARE_INCENTIVO:
LOAD
NIVEL,
INCENTIVO,
DE,
ATE,
COD_FORNECEDOR
FROM TABELA_SHARE_INCENTIVO.qvd
(qvd);
Left join(TABELA_TOTAIS_FORNECEDOR)
IntervalMatch(ACUMULADO)
LOAD
DE,
ATE
Resident TABELA_SHARE_INCENTIVO;
//
////
//////UNE AS TABELAS TOTAL FORNECEDOR E SHARE INCENTIVO
left join (TABELA_TOTAIS_FORNECEDOR)
LOAD
*
Resident TABELA_SHARE_INCENTIVO;
//
//
drop table TABELA_SHARE_INCENTIVO;
Bom dia Yuri, estou sofrendo ainda com o intervalmatch, eu fiz o acumulado diretamente no sql, tentei fazer o intervalmatch por mes ano, pelo acumulado. E sempre que tento algo os valores só aumentam. Conseguiria me ajudar?