4 Replies Latest reply: Sep 11, 2015 9:56 AM by Sunny Talwar RSS

    RangeSum with Aggr

    Juan Olivares

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

        • Re: RangeSum with Aggr
          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?

          • Re: RangeSum with Aggr

            Hi

            Is that you want

             

            See below attached files.

              • Re: RangeSum with Aggr
                Juan Olivares

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