Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

hopkinsc
Not applicable

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

Weekly Sales

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

Weekly Sales

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

Weekly Sales

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

Weekly Sales

Hi      Stefan,

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

Thanks for your help.

Chris