Topic: Sort using parameter not group Posted: 17 May 2013 at 6:07am
Hello everyone,
I am trying to get my report to use a parameter as my sort option. I would like it to sort in date order or by the difference in dollars.
but I cannot figure out why it's not working.
my formula is:
if {?Sort Option} = '1' then ToText ({date.field}, "yyyy-mm-dd") else
if {?Sort Option} = '2' then GroupName ({@dollardiff})
I put this formula in my report header. When I go to sort expert my formula Sort Option is not even one that is listed as a field to choose. What am I doing wrong??
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 17 May 2013 at 6:52am
what is the dollardiff formula?
depending on how it is written it may occur in a pass that happens after sorting so it will not be allowed to be used as a sort field.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 17 May 2013 at 11:17am
I don't know about the sort options...since I never use them, but what you can do is create a group, and use the formula as the grouping criteria.
Though as DBlank mentioned, if the data in the dollardiff formula is not 'intrinisically' in the data...ie CR can't just subtract 2 fields from each other in the same row it won't work.
Because as DBlank mentioned, if the computation cannot be done before the writing of records to the report, CR cannot group/sort...really do anything like that as the values are not there.
The formula for dollardiff is the difference between actual and estimated dollars. I never considered that the formula would calculate after the sort. That makes sense. Thank you both for your assistance, I thought it was something that I wasn't doing correctly.
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