4 Replies Latest reply: Dec 12, 2011 8:02 AM by Chris Hopkins RSS

    Weekly Sales

    Chris Hopkins


      I have an application showing wastage. in my chart the results are broken down by day. I also have sales on the chart so i can do a waste % of sales.

      I have been asked to display weekly sales also.

      Can anyone help me on expression to show weekly sales please?

      it would need to disregard the specific date and look at the week instead.


      My fields are:


      Cal_Week = Week

      Store_Date = Specific Date

      SalesQuantity = Sales



        • Weekly Sales
          Stefan Wühl

          You want to show this value in the same table with dimension Store_Date, repeating the weekly value for every row with a date within the week?



          =aggr( sum( total<Cal_Week> SalesQuantity), Cal_Week, Store_Date)


          Hope this helps,


            • Weekly Sales
              Chris Hopkins

              Hi Stefan,


              Sorry it has taken me so long to respond...


              That expression doesnt work for me. it shows the same value against a product for each day of the week.

              Any ideas?







                • Weekly Sales
                  Stefan Wühl



                  so you want the weekly per product, right?


                  Then we need to add the e.g. ProductCode to the expression:


                  =aggr( sum( total<ProductCode, Cal_Week> SalesQuantity), ProductCode, Cal_Week, Store_Date)


                  Since you are using some more dimensions, we might also need to use the NODISTINCT qualifier:

                  =aggr(NODISTINCT sum( total<ProductCode, Cal_Week> SalesQuantity), ProductCode, Cal_Week, Store_Date)


                  Or am I misunderstanding your requirement?