Hello all,
I am attempting to utilize the Assign function in Report Designer to sort a series of variables.
The basic concept is:
=iif($Thing1<$Thing2,Assign( '$temp', $Thing1 ),'')
=iif($Thing1<$Thing2,Assign( '$Thing1', $Thing2 ),'')
=IIf($Thing1=$Thing2, Assign( '$Thing2', $temp ),'')
While this works if Thing 1 is indeed less than Thing 2, as soon as Thing 1 is greater than Thing 2 it fails.
I have been trying to trace the problem, and it seems that the Assign function is being triggered even if the first part of this IF statement is false. It is populating the $temp variable with a new number, when it should just do nothing.
=iif($Thing1<$Thing2,Assign( '$temp', $Thing1 ),'')
I have each section of the If statements above in a new group header, because I cannot utilize an assigned variable within the same section.
I have double checked the values after each step to pinpoint the problem
I’ve tried placing something in the third section of the IF statement (just adding the word fail) but that didn’t stop it from triggering the assign function.
Can anyone suggest any solution to this problem? Or a better way to sort numbers in a group when sorting the group isn’t an option (can’t sort the group by a sum).
Thank you,
Helen