Print Page | Close Window

week by week as rows and last 2 years as columns

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22439
Printed Date: 25 Apr 2024 at 5:37am


Topic: week by week as rows and last 2 years as columns
Posted By: wildinsalem
Subject: week by week as rows and last 2 years as columns
Date Posted: 03 Sep 2017 at 5:47am
I'm trying to create a report that shows sales by week (date part of ship date) as rows and using if thens to create the totals by year (also date part as ship date) as columns. But I'm getting multiple rows so my report looks like this:

Week 1 | Blackberries | 2016 Amount - $123.45 | 2017 - $0
Week 1 | Blackberries | 2016 Amount - $0 | 2017 - $123.45

and so on....

I think it's a group by problem but I don't know how to do this, create a subgroup or running total to get this right? Does anyone have an example they could show me?

Thanks!



Replies:
Posted By: hilfy
Date Posted: 13 Sep 2017 at 3:45am
Try using a crosstab. Based on your example, your row groups would be week and product, your column group would be year of the week, and your summary field would be a sum of the amount.

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window