6 Replies Latest reply on Feb 27, 2015 7:26 AM by disabled_Rob_2

# GLOBAL FIELD ITEMS SORTED INSIDE A VARIABLE

### Title

GLOBAL FIELD ITEMS SORTED INSIDE A VARIABLE

### Post

" GLOBAL FIELD ITEMS SORTED INSIDE A VARIABLE"

How would you filter
A Global List such as

1 doors
3 windows
5 chairs
1 rug
10 lamps

the items are listed in a global field along with their number of occurrences from a text field called TopicLetters.

Wanting to sort these items from top to bottom high to low rearranged the list in my global field called unique words and their occurrence.

i could simply create a new record throw them into a field that's indexed and sort them and grab them to put back into the global field then delete the new record.

But was thinking maybe they can be sorted inside a variable some way using filter values. A filter expression that allowed me to dictate what to filter thus arrive at the sorting of .. GLOBAL FIELD ITEMS INSIDE A VARIABLE!!

Robert

• ###### 1. Re: GLOBAL FIELD ITEMS SORTED INSIDE A VARIABLE

Which could be the highter number of a single item ? ( in your example is 10 )
How many items could be into the global field ? ( in your example are 5 )

• ###### 3. Re: GLOBAL FIELD ITEMS SORTED INSIDE A VARIABLE

I do not understand much of what you said ( I'm Italian ). BTW this calculation works for your first example.
I think that you'll need to create a custom function or a looping script with my calc in mind.

This returns:

10 lamps
5 chairs
3 windows
1 doors
1 rug

Let([
T = YourTextField ;
SN = FilterValues ( "20¶19¶18¶17¶16¶15¶14¶13¶12¶11¶10¶9¶8¶7¶6¶5¶4¶3¶2¶1" ; Filter ( T ; "1234567890¶" ) ) ; // sorted numbers
VWD = Filter ( T ; KanjiNumeral ( T ) ) // values without digits
];
FilterValues ( T ;
GetValue ( SN  ; 1 )  & GetValue ( VWD ; 1 ) & ¶ &
GetValue ( SN  ; 1 )  & GetValue ( VWD ; 2 ) & ¶ &
GetValue ( SN  ; 1 )  & GetValue ( VWD ; 3 ) & ¶ &
GetValue ( SN  ; 1 )  & GetValue ( VWD ; 4 ) & ¶ &
GetValue ( SN  ; 1 )  & GetValue ( VWD ; 5 )
)
&
FilterValues ( T ;
GetValue ( SN  ; 2 )  & GetValue ( VWD ; 1 ) & ¶ &
GetValue ( SN  ; 2 )  & GetValue ( VWD ; 2 ) & ¶ &
GetValue ( SN  ; 2 )  & GetValue ( VWD ; 3 ) & ¶ &
GetValue ( SN  ; 2 )  & GetValue ( VWD ; 4 ) & ¶ &
GetValue ( SN  ; 2 )  & GetValue ( VWD ; 5 )
)
&
FilterValues ( T ;
GetValue ( SN  ; 3 )  & GetValue ( VWD ; 1 ) & ¶ &
GetValue ( SN  ; 3 )  & GetValue ( VWD ; 2 ) & ¶ &
GetValue ( SN  ; 3 )  & GetValue ( VWD ; 3 ) & ¶ &
GetValue ( SN  ; 3 )  & GetValue ( VWD ; 4 ) & ¶ &
GetValue ( SN  ; 3 )  & GetValue ( VWD ; 5 )
)
&
FilterValues ( T ;
GetValue ( SN  ; 4 )  & GetValue ( VWD ; 1 ) & ¶ &
GetValue ( SN  ; 4 )  & GetValue ( VWD ; 2 ) & ¶ &
GetValue ( SN  ; 4 )  & GetValue ( VWD ; 3 ) & ¶ &
GetValue ( SN  ; 4 )  & GetValue ( VWD ; 4 ) & ¶ &
GetValue ( SN  ; 4 )  & GetValue ( VWD ; 5 )
)
&
FilterValues ( T ;
GetValue ( SN  ; 5 )  & GetValue ( VWD ; 1 ) & ¶ &
GetValue ( SN  ; 5 )  & GetValue ( VWD ; 2 ) & ¶ &
GetValue ( SN  ; 5 )  & GetValue ( VWD ; 3 ) & ¶ &
GetValue ( SN  ; 5 )  & GetValue ( VWD ; 4 ) & ¶ &
GetValue ( SN  ; 5 )  & GetValue ( VWD ; 5 )
)
)

• ###### 4. Re: GLOBAL FIELD ITEMS SORTED INSIDE A VARIABLE

So u saying.. with your above filter expression in a loop

it will allow more values to be processed?  _i_ can't see that possible?

thats a long expression already for just filtering only 5 items!

_i_ think your right  it could be shorter by putting it into a Loop process??

• ###### 5. Re: GLOBAL FIELD ITEMS SORTED INSIDE A VARIABLE

Maybe _i_am wrong!!  Sounds like creating a table adding a relationship creating a layout and adding fields might be more minimal programming less work than evolving a looping expression?

• ###### 6. Re: GLOBAL FIELD ITEMS SORTED INSIDE A VARIABLE

No !!  _i_am not wrong !!

Here, IS the way, how you sorta value List  inside a global field:

BubbleSort ( inputValues ; iterations )

Sorts a list of return-separated values.

Thank You,

Robert