Link to home
Start Free TrialLog in
Avatar of kingjely
kingjelyFlag for Australia

asked on

Conditional formatting of Group Sort order constants

I have Best/Worst sellers report

I am using the Group expert\"SORT"\Options\X2 to out put whether my report is a best or worst sellers, or CrascendingOrder or CrdescendingOrder

"SORT" is a formular feild ;

If {?SORT} = "48" then {styleperformance.QtyRecv} else
If {?SORT} = "49" then {styleperformance.QtyOnHand} else
if {?SORT} = "53" then {styleperformance.QtySold} else
if {?SORT} = "54" then {@DAYS TO TOI} else
if {?SORT} = "55" then {@DaysinPeriod}

I have a Parameterfeild, {?reporttype} "best" or "Worst"

I want to say,

If {?ReportType} = "Best" and  {?Sort} = "48" or "49" or "53"  then Crascending else descending;
if {?ReportType} = "Worst" and {?Sort} = "54" or "55" then CrDescending else CrAscending;


I need this otherwize My best is always Descending... And "Days to turn over inventory", and Days in Period are only best sellers if they are Ascending.

Couls someone help me, to see if

1) its possible to do what i want to do in this X2 part of the sort  and
2) how to write the formular

Thanks
Jason



Avatar of kingjely
kingjely
Flag of Australia image

ASKER



I tried this, but it says "the formular Result is not valid for this formular"
Im doing it wrong, coz i need the case "Best" to be  

Case {?ReportType} = Best



Numbervar x;

For x := 1 to Len({?SORT}) Step 2
    do
    Select mid({?SORT},x,2)
    Case "Best":
  If {?SORT} = "48" then CrDescendingOrder else CrascendingOrder
    Case "Best":
  If {?Sort} = "49" then CrDescendingOrder else CrascendingOrder
    Case "Best":
  If {?SORT} = "53" then CrDescendingOrder else CrAscendingOrder
    Case "Best":
  If {?SORT} = "54" then CrAscendingOrder else CrDescendingOrder
    Case "Best":
  If {?Sort} = "55" then CrAscendingOrder else CrDescendingOrder
    Case "Worst":
  If {?Sort} = "48" then CrAscendingOrder else CrDescendingOrder
    Case "Worst":
  If {?Sort} = "49" then CrAscendingOrder else CrdescendingOrder
    Case "Worst":
  If {?Sort} = "53" then CrAscendingOrder else CrDescendingOrder
    Case "Worst":
  If {?Sort} = "54" then CrDescendingOrder else CrAscendingOrder
    Case "Worst":
  If {?Sort} = "55" then CrDescendingOrder else CrAscendingOrder;
   
x
ASKER CERTIFIED SOLUTION
Avatar of James0628
James0628

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great work mate,

Yes i work myself into circles, i get confused, and just try stuff, I dont have any help or guidance or training, so it drives me nuts when i cant understand or can't ask anyone.

Thanks Very much for your help and patience

Jason

Avatar of James0628
James0628

You're welcome.  Glad I could help.

 Just to be clear, I wasn't trying to criticize your second formula in any way.  Yes, to be honest, it was a mess ;-), but that wasn't my point.  I was just trying to make it clear that I wasn't trying to go by anything in that formula.  I was only looking at those conditions from your original post.

 James