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

Group/Sorting Shared Variables?

Status
Not open for further replies.

vangyer

Technical User
Sep 25, 2012
5
US
I might be making this too complicated but basically I need to sort a report by dimensions each dimension has an element.

Overall
Opening
Length

Sometimes an object can have all 3 or just one or 2 of the options.
if there are 3 objects the first one has all 3 elements and the other two only has one of the element, I'd like to extract Length as the dimension to sort by in the first object.

I was able to pass the value using shared variables but unfort. you can't sort by a shared variable, any help would be appreciated?
 
Unclear on the data structure. Is it one record with three fields, or would you have three records if you have all three elements?
 
create a formula something like this

if isnull({table.length)) and isnull({table.opening}) and isnull({table.overall})
then 0
else
If not(isnull({table.length}))
then {table.length}
else
if not(isnull({table.secondchoice}))
then {table.secondchoice}
else {table.thirdchoice}
 
sorry should have clarified, all the values are in a single field
"table.dimension" but is designated through a separate field "table.dimensionelement"

I tried a if/then on element but need it to loop all the way through and it was just picking the first dimension.

basically i need it to read through all the dimension elements, assign rank and then sort by the value of the no. 1 ranked element


Object ID 1:
Length: 24
Overall: 38x43x24
Opening: 12

Object ID 2:
Length 24

Object ID 3:
Opening: 8
Overall: 3

need the report to sort
Object ID 3
Object ID 1
Object ID 2

Use Length dim to sort first, if no length then use Opening, if no opening then use dimension from Overall but then sort by the actual dimension value not element.






 
sorry since first 2 objects have the same dimension for length, i wouldn't need a specific order for those two.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top