Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Subtotalling Problem....

Hi

Please see below.

My Raw data is listed by day, but I want to display the average for a 7 day period (obviously a week!) in my chart.

subtotals.png

Im not sure which is the nbest way to tackle this as the raw data does not have a 'week' reference in it.

I would be very grateful for some pointers please!

Thanks

7 Replies
rajni_batra
Specialist
Specialist

use week function for this

week(Date )

or weekday(Date)

will return you week of respective Date

Hope to Help!!!

Not applicable
Author

Thanks for your quick reply - Im new to Qlikview, could you explain a little bit more exactly where and how I use this function?

Thanks

Ian

rajni_batra
Specialist
Specialist

I tried this but confused that may be u wouldn't need it like this check it out n Let me Know

rajni_batra
Specialist
Specialist

Check this one also contains Avg (Amount) also..

Not applicable
Author

Hi

Thanks for your reply, but I'm still struggling to understand....

How will qlikview understand where the week starts and finishes? Does it need some sort of lookup table to return a value from?

Thanks

Ian

Not applicable
Author

So how does it know which days make the week? (Sat to Friday or Monday to sunday etc)?

Thanks

ian

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

In your load statement, add the week like this

LOAD Day,

     Amount,

     Week(Day) As WeekNo,

     ...

FROM ...

Now create a chart wih WeekNo as the dimension, and Sum(Amount) as the expression.

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein