Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A different Sort in each report grouping

Status
Not open for further replies.

steever

MIS
Mar 25, 2003
43
CA
Can this be done, or are you restricted to the same sort across all report groupings??

ie. Goup1 - sort Last name,
Group2 - sort First Name,
etc.

thx a lot!

Steve

(using Crystal 10)
 
Hi,
Group IS a sort, so your question is a little unclear..

If your Group by LastName and then Sort by First Name you will get the output arranged like you seem to want..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
thx for the fast response, Turk.

Sorry, I used a poor off the top of my head example. What I'm actually doing is:

I've grouped 'critical incidents' by several periods (calculated) - Previous period, current period, next period, etc. The incidents are sorted by the date they were opened. What the client is hoping to do is sort the incidents that fall in the next period by another field - Impact, while leaving the current sort in the previous period. I need to do some sort of if..else here. IE. If period = next or period = future sort by IMpact. Just not sure if this is possible or what the suggestible way of doing this would be.

thx.

S
 
If you are talking about sorting within a group, then you could use a formula like:

if period = next then
{table.impact} else ""

It's sort of hard to respond without knowing your actual fields. The above assumes impact is a string. If it's a number, set it to 0. Replace the period clause with however you are defining next. However, note that this will not work if you are using the previous() or next() functions to define the periods. For more help, please share the contents of your period formula.

-LB
 
Try:

if {@MyGroupingField) = "Previous period" then
{table.field1}
else
if {@MyGroupingField) = "current period" then
{table.field2}
else
if {@MyGroupingField) = "next period" then
{table.field3}
else
{table.field4}

Then use this formula as your Sort field.

Try posting actual field names to get tailored responses.

-k
 
thx Guys, sorry to be so long in getting back on this (got dragged into something else).

Yes, those are both the types of solutions i'm looking for, just having a lil trouble imlementing. :)

When I do the recommended caclulation, and bring into sort list, it throws off all my dates. ie. incidents that should fall into the "next period" grouping all of a sudden are in my "previous period. It does however sort all incidents on Impact level (as I want) in each group. When I sort first on the date, then on this calculation impact, the dates come in chronologically and respective of group, however that also overrides my secondary Impact sort (as the app should).

The whole report needs to be sorted chronologically by date, but within my future periods I need this sort broken and the "Impcact" level of the incident to take its place.

Am I missing something here ?? :)

and again, thx guys.

 
You have not shown us the actual fields you are working with. We don't know how you are creating the periods. Can't really help without more detail about the groupings, fields, etc.

-LB
 
Some more detail ....

I'm creating 4 periods - Previous, Current, Next, Future. They all start on a Tuesday, so Previous is prior Tuesday to current Tue, Current is current Tue to nxt Tue, Next is nxt Tue to the week after nxt Tue, Future is week after nxt Tues, until 99 days into the future (based off system date).

ie. date(datetime(minimum(LastFullWeek)+ 2)) is calc for Previous week. I simply add 7 to the number at end to create Current, 16 to get next, and so on ...

I then have a grouping calculation that classifies each incident as one of the 4 above.

ie.

if {cm3rm1.sched.outage.start} < {@CALC_period_current} then 'i) Previous Period'
else if
{cm3rm1.sched.outage.start} < {@CALC_period_next} then 'ii) Current Period'
else if
{cm3rm1.sched.outage.start} < {@CALC_period_future} then 'iii) Next Period'
else if
{cm3rm1.sched.outage.start} > {@CALC_period_next} then 'iv) In the Future'


I then group the report based on these periods. This, by default, sorts incidents by date in each period. This is all fine and well, but I need to have the primary sort on a field called "impact" for just my Next/Future groups, with things remainging the same for my Previous/Current.

hoping this makes sense...



 
If you group on:

if {cm3rm1.sched.outage.start} < {@CALC_period_current} then 'i) Previous Period'
else if
{cm3rm1.sched.outage.start} < {@CALC_period_next} then 'ii) Current Period'
else if
{cm3rm1.sched.outage.start} < {@CALC_period_future} then 'iii) Next Period'
else if
{cm3rm1.sched.outage.start} > {@CALC_period_next} then 'iv) In the Future'

Your only sort will be by the resulting string. You should remove any date sort and then create a formula like:

if {@youraboveformula} in ["iii) Next Period","iv) In the Future"] then {table.impact} else
{cm3rm1.sched.outage.start}

Use this formula as your record sort field.

-LB
 
lbass, works fantastic!
I think my leaving the date sort in there along with the formula was throwing everything off.

your help is much appreciated.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top