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.
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.
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.
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.
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.
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.
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}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.