Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

jolivares
Valued Contributor

RangeSum with Aggr

Hi community, i was trying to make this chart, please take a moment and see this...Capture.PNG

1 Solution

Accepted Solutions

Re: RangeSum with Aggr

This?

Capture.PNG

Had to make a slight script change:

T1:

LOAD *,

  Ped&Pos as Field;

LOAD * INLINE [

    Prod, Ped, Pos, Rep, Cant

    M1, Pe1, Po1, Re1, 50

    M1, Pe1, Po2, Re1, 100

    M1, Pe1, Po3, Re1, 100

    M1, Pe1, Po4, Re1, 100

    M1, Pe1, Po5, Re1, 100

    M1, Pe1, Po6, Re1, 100

    M1, Pe1, Po7, Re1, 125

    M2, Pe2, Po1, Re1, 75

    M2, Pe2, Po2, Re1, 100

    M2, Pe2, Po3, Re1, 100

    M2, Pe2, Po4, Re1, 100

    M2, Pe2, Po5, Re1, 100

    M2, Pe2, Po6, Re1, 100

    M2, Pe2, Po7, Re1, 100

    M2, Pe2, Po8, Re1, 100

    M2, Pe2, Po9, Re1, 150

    M1, Pe3, Po1, Re1, 50

    M1, Pe3, Po2, Re1, 100

    M1, Pe3, Po3, Re1, 100

    M1, Pe3, Po4, Re1, 100

];

Expression for Total Qty:

=RangeSum(Above(TOTAL Sum(Cant), 0, Aggr(RowNo(), Prod, Field)))

Attaching the qvw for review.

HTH

Best,

Sunny

4 Replies

Re: RangeSum with Aggr

I am working with Personal Edition of QlikView, would you be able to share the data source behind the sample application you have shared as well as the expression you are using?

prajapatiamar38
Contributor II

Re: RangeSum with Aggr

Hi

Is that you want

See below attached files.

jolivares
Valued Contributor

Re: RangeSum with Aggr

No Amarnath, if you see the picture attached, I need a whole sum for each "Prod", in your answer is just without the subtotal.

For Sunny this is the data: Try

T1:

LOAD * INLINE [

    Prod, Ped, Pos, Rep, Cant

    M1, Pe1, Po1, Re1, 50

    M1, Pe1, Po2, Re1, 100

    M1, Pe1, Po3, Re1, 100

    M1, Pe1, Po4, Re1, 100

    M1, Pe1, Po5, Re1, 100

    M1, Pe1, Po6, Re1, 100

    M1, Pe1, Po7, Re1, 125

    M2, Pe2, Po1, Re1, 75

    M2, Pe2, Po2, Re1, 100

    M2, Pe2, Po3, Re1, 100

    M2, Pe2, Po4, Re1, 100

    M2, Pe2, Po5, Re1, 100

    M2, Pe2, Po6, Re1, 100

    M2, Pe2, Po7, Re1, 100

    M2, Pe2, Po8, Re1, 100

    M2, Pe2, Po9, Re1, 150

    M1, Pe3, Po1, Re1, 50

    M1, Pe3, Po2, Re1, 100

    M1, Pe3, Po3, Re1, 100

    M1, Pe3, Po4, Re1, 100

];

Re: RangeSum with Aggr

This?

Capture.PNG

Had to make a slight script change:

T1:

LOAD *,

  Ped&Pos as Field;

LOAD * INLINE [

    Prod, Ped, Pos, Rep, Cant

    M1, Pe1, Po1, Re1, 50

    M1, Pe1, Po2, Re1, 100

    M1, Pe1, Po3, Re1, 100

    M1, Pe1, Po4, Re1, 100

    M1, Pe1, Po5, Re1, 100

    M1, Pe1, Po6, Re1, 100

    M1, Pe1, Po7, Re1, 125

    M2, Pe2, Po1, Re1, 75

    M2, Pe2, Po2, Re1, 100

    M2, Pe2, Po3, Re1, 100

    M2, Pe2, Po4, Re1, 100

    M2, Pe2, Po5, Re1, 100

    M2, Pe2, Po6, Re1, 100

    M2, Pe2, Po7, Re1, 100

    M2, Pe2, Po8, Re1, 100

    M2, Pe2, Po9, Re1, 150

    M1, Pe3, Po1, Re1, 50

    M1, Pe3, Po2, Re1, 100

    M1, Pe3, Po3, Re1, 100

    M1, Pe3, Po4, Re1, 100

];

Expression for Total Qty:

=RangeSum(Above(TOTAL Sum(Cant), 0, Aggr(RowNo(), Prod, Field)))

Attaching the qvw for review.

HTH

Best,

Sunny

Community Browser