Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
jolivares
Specialist
Specialist

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
sunny_talwar

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

View solution in original post

4 Replies
sunny_talwar

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
Creator II
Creator II

Hi

Is that you want

See below attached files.

jolivares
Specialist
Specialist
Author

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

];

sunny_talwar

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