Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Crosstab Top N Columns Post Reply Post New Topic
Author Message
angarakiran777
Newbie
Newbie


Joined: 22 Dec 2009
Location: Malaysia
Online Status: Offline
Posts: 13
Quote angarakiran777 Replybullet Topic: Crosstab Top N Columns
     Posted: 22 Aug 2013 at 10:04pm
Hi,

I designed a cross tab report with delivery date as column header but i want only the last 5 dates only.

I am using CR XI.

Please help

Thank You,
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 23 Aug 2013 at 1:55am
Hi

This is possible only if you use free hand sql. Because, we can't use maximum() or count() functions to filter data in record / group seleciton.

If you want top 5 then

SELECT TOP 5 DateField FROM TableName ORDER BY DateField

If you want bottom 5 THEN

SELECT TOP 5 DateField FROM TableName ORDER BY DateField DESC

Now create a cross tab
Thanks,
Sastry
IP IP Logged
angarakiran777
Newbie
Newbie


Joined: 22 Dec 2009
Location: Malaysia
Online Status: Offline
Posts: 13
Quote angarakiran777 Replybullet Posted: 23 Aug 2013 at 4:39am
hi,
thank you for your valuable support.
 
I understood your idea but I group the orders by customers then by date so each customer will have different delivery dates. I want each customer last 5 delivery dates.
 
thank you.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 23 Aug 2013 at 5:34am
HI

This is possible only in standard report not in Cross Tab report.

Try, if you can convert your report to standard report or you may have to take care this requirement at SQL level.
Thanks,
Sastry
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum