5 Replies Latest reply: May 22, 2013 1:50 AM by Gus Ajram

# Sales Comparisons based on date ranges, yearly 3 months  etc

Hi All,

Need some help please, I know its pretty straight forward however I'm still learning the date functions in qlikview.

I basically need the table below replicated in qlikview.

DimensionTotal Sales Last 12 MonthsTotal Sales Previous 3 MonthsTotal Sales Current Month

Thank you

• ###### Re: Sales Comparisons based on date ranges, yearly 3 months  etc

Hi jajram944,

Here is just an idea to implement in QlikView:

1. Total Sales Current Month

= Sum({\$<MonthID = {\$(=Max(MonthID))},Year = {\$(=Max(Year))},Quarter = , Month = >} Sales)

2. Total Sales Previous 3 Months

= Sum({\$<MonthID = {\$(=Max(MonthID)-3)},Year = ,Quarter = , Month = >} Sales)

3. Total Sales Last 12 Months

= Sum({\$<MonthID = {\$(=Max(MonthID)-12)},Year = ,Quarter = , Month = >} Sales)

It would be greate if you can share sample data.

Regards,

Sokkorn

• ###### Re: Sales Comparisons based on date ranges, yearly 3 months  etc

Unfortunately I'm unable to share my data.

Is it possible you can explain or break down the expression so I know what to replace each section with to match my data?

Thanks

• ###### Re: Sales Comparisons based on date ranges, yearly 3 months  etc

Solution suggested by Sokkorn is perfect and it should definitely work.

• ###### Re: Sales Comparisons based on date ranges, yearly 3 months  etc

It does, Thanks

• ###### Re: Sales Comparisons based on date ranges, yearly 3 months  etc

Thanks