Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Weekly Sales

Hi,

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

Thanks

4 Replies
swuehl
MVP
MVP

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?

Try

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

Hope this helps,

Stefan

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

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?

thanks

Chris

Example.JPG

swuehl
MVP
MVP

Chris,

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?

Regards,

Stefan

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi      Stefan,

You are not misunderstanding anything, and the last expression works perfectly.

Thanks for your help.

Chris