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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sort order

Status
Not open for further replies.

mart10

MIS
Nov 2, 2007
394
0
0
GB
I am using CR16

I have a parameter which allows user to say if they want to sort by currency or %movement. This parameter is applied to a group level which is hidden

It works fine except the sort order for %movemnt doesnt always show in order I would expect

eg it can show 1.01
2.06
22.98
5.75
6.30

I would expect it to be

1.01
2.06
5.75
6.30
22.98

The group level is defined as follows
and I think the issue is something to do with the formula where it asks me to put the %Movement in text in order for it to work

If {?SortOrder}="Currency" then {View_CurrencyPairs_v2.Ccy2} else totext({@Movement%})
 
Apparently the data type of View_CurrencyPairs_v2.Ccy2 is text (Otherwise you would get an error with your If statement). Text does a different sort order than numeric. Not sure of an easy fix to this. Someone else got any ideas?
 
The trouble is if I do that it falls over when trying to display by currency rather than % movement. I have a parameter called sort order you see

When I put tonumber before FXRATES_1st.ccy it doesn't like it

If {?SortOrder}= "Currency" then tonumber({FXRATES_1st.ccy}) else ({@Movement%})
 
Pad the number with leading zeros and use that as the sort order, but just display the number. It might look something like this (assuming that all numbers will have 2 decimal places):

Right('000' + {@Movement%}, 6)

-Dell



Senior Manager, Data & Analytics
Protiviti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top