Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
sum( aggr (
pick(match(#um,'PL','KG','PZ','CT'),
if(PCU_0='PL',sum({$<Anno={$(vyear)},[%Tp_dato]={1},tipo_omaggio={1},segno={1}>}#qnt*PCUSTUCOE_0)+sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt*PCUSTUCOE_0),
If(PCU_1='PL',sum({$<Anno={$(vyear)},[%Tp_dato]={1},tipo_omaggio={1},segno={1}>}#qnt*PCUSTUCOE_1)+sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt*PCUSTUCOE_1),
If(PCU_2='PL',sum({$<Anno={$(vyear)},[%Tp_dato]={1},tipo_omaggio={1},segno={1}>}#qnt*PCUSTUCOE_2)+sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt*PCUSTUCOE_2)
))),
//nel caso in cui servisse la dimensione vanno cconsiderati i pezzi e i ct in base ai pezzi cy
//sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>} floor(#qnt/peso_medio_agan,1))+
//sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}floor(#qnt/peso_medio_agan,1)),
sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt)+
sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt),
sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt)+
sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt),
if(unita_mag_art='PZ',
sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt*pezzi_cart_kg_agan)+
sum({$<Anno={$(vyear)},[%Tp_dato]={3},[%Fattura]={'nd'},tipo_omaggio={1}>}#qnt*pezzi_cart_kg_agan),
sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt)+
sum({$<Anno={$(vyear)},[%Tp_dato]={3},[%Fattura]={'nd'},tipo_omaggio={1}>}#qnt))
)
, [%Articolo],#um,unita_mag_art))
and the result is:
Now i'd like to see for each "Cod.Articolo" the Total not considering subdivision on cod_lotto.
The result should be:
Is it possible???
Thank you all.
May be this
sum(TOTAL <[%Articolo], #um> Aggr( Pick(Match(#um,'PL','KG','PZ','CT'), if(PCU_0='PL',sum({$<Anno={$(vyear)},[%Tp_dato]={1},tipo_omaggio={1},segno={1}>}#qnt*PCUSTUCOE_0)+sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt*PCUSTUCOE_0), If(PCU_1='PL',sum({$<Anno={$(vyear)},[%Tp_dato]={1},tipo_omaggio={1},segno={1}>}#qnt*PCUSTUCOE_1)+sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt*PCUSTUCOE_1), If(PCU_2='PL',sum({$<Anno={$(vyear)},[%Tp_dato]={1},tipo_omaggio={1},segno={1}>}#qnt*PCUSTUCOE_2)+sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt*PCUSTUCOE_2) ))), //nel caso in cui servisse la dimensione vanno cconsiderati i pezzi e i ct in base ai pezzi cy //sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>} floor(#qnt/peso_medio_agan,1))+ //sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}floor(#qnt/peso_medio_agan,1)), sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt)+ sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt), sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt)+ sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt), if(unita_mag_art='PZ', sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt*pezzi_cart_kg_agan)+ sum({$<Anno={$(vyear)},[%Tp_dato]={3},[%Fattura]={'nd'},tipo_omaggio={1}>}#qnt*pezzi_cart_kg_agan), sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt)+ sum({$<Anno={$(vyear)},[%Tp_dato]={3},[%Fattura]={'nd'},tipo_omaggio={1}>}#qnt)) ) , [%Articolo],#um,unita_mag_art))
Here I am assuming that [#um] = [Unita di magazzin] and [%Articolo] = [Cod.Articolo]
May be this
sum(TOTAL <[%Articolo], #um> Aggr( Pick(Match(#um,'PL','KG','PZ','CT'), if(PCU_0='PL',sum({$<Anno={$(vyear)},[%Tp_dato]={1},tipo_omaggio={1},segno={1}>}#qnt*PCUSTUCOE_0)+sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt*PCUSTUCOE_0), If(PCU_1='PL',sum({$<Anno={$(vyear)},[%Tp_dato]={1},tipo_omaggio={1},segno={1}>}#qnt*PCUSTUCOE_1)+sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt*PCUSTUCOE_1), If(PCU_2='PL',sum({$<Anno={$(vyear)},[%Tp_dato]={1},tipo_omaggio={1},segno={1}>}#qnt*PCUSTUCOE_2)+sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt*PCUSTUCOE_2) ))), //nel caso in cui servisse la dimensione vanno cconsiderati i pezzi e i ct in base ai pezzi cy //sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>} floor(#qnt/peso_medio_agan,1))+ //sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}floor(#qnt/peso_medio_agan,1)), sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt)+ sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt), sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt)+ sum({$<Anno={$(vyear)},[%Tp_dato]={3},%Fattura={'nd'},tipo_omaggio={1}>}#qnt), if(unita_mag_art='PZ', sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt*pezzi_cart_kg_agan)+ sum({$<Anno={$(vyear)},[%Tp_dato]={3},[%Fattura]={'nd'},tipo_omaggio={1}>}#qnt*pezzi_cart_kg_agan), sum({$<Anno={$(vyear)},[%Tp_dato]={1},segno={1},tipo_omaggio={1}>}#qnt)+ sum({$<Anno={$(vyear)},[%Tp_dato]={3},[%Fattura]={'nd'},tipo_omaggio={1}>}#qnt)) ) , [%Articolo],#um,unita_mag_art))
Here I am assuming that [#um] = [Unita di magazzin] and [%Articolo] = [Cod.Articolo]