Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
maxwellf
Contributor III
Contributor III

Soma acumulativa no LOAD

Preciso fazer uma soma acumulada no LOAD para montar a curva

 

Tenho o script para gerar a porcentagem

calc_divisao:
LOAD
%pk_cliente,
num(sum(soma / soma_total),'0,00000000') as curva_vlr
resident Plan
group by %pk_cliente
;

 

 

Como faço para acumular  CURVA_VLR até chegar aos 100%?

Labels (1)
1 Solution

Accepted Solutions
maxwellf
Contributor III
Contributor III
Author

Consegui fazer assim:

curva_abc_acum:
LOAD
if(len(Peek('%pk_cliente'))=0,curva_vlr,
IF(Peek('%pk_cliente')<> %pk_cliente,
Peek('Pareto')+curva_vlr,
Peek('Pareto'))) as Pareto,
%pk_cliente
resident calc_divisao
order by curva_vlr desc;

View solution in original post

1 Reply
maxwellf
Contributor III
Contributor III
Author

Consegui fazer assim:

curva_abc_acum:
LOAD
if(len(Peek('%pk_cliente'))=0,curva_vlr,
IF(Peek('%pk_cliente')<> %pk_cliente,
Peek('Pareto')+curva_vlr,
Peek('Pareto'))) as Pareto,
%pk_cliente
resident calc_divisao
order by curva_vlr desc;