Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Random numbers


Jorgen

Recommended Posts

Hi There,

 

I'm have a database with musicfiles and they always come up sorted on artist, title or year. Is there a way within an extra field to create automatically a random number (witch changes now and then) so i can sort on that random number?

 

Thanks

Jorgen

Link to comment
Share on other sites

This should be an unstored calc then I think.

If your database is (very) large and you only incidentally want to change the sort order using this method, a scripted solution might be the way to go.

 

the random sort field would then be a number field, and the script would be

 

go to layout [ your layout ]

freeze window

replace field contents [ RandomSortField ; by calculation, =Random ]

sort [ restore ]

Link to comment
Share on other sites

Create a new calculation field on the table, and set it to the function called Random. Then sort on this field.

Thanks, this working fine

Didn't new is was so easy

 

See further under

 

Tnx Jorgen

Link to comment
Share on other sites

This should be an unstored calc then I think.

If your database is (very) large and you only incidentally want to change the sort order using this method, a scripted solution might be the way to go.

 

the random sort field would then be a number field, and the script would be

 

go to layout [ your layout ]

freeze window

replace field contents [ RandomSortField ; by calculation, =Random ]

sort [ restore ]

I've done the first thing. I created a new file reference with 2 field. One is a a relation field (=tracknumber) wich is connected to the main database. The second one is the random field. This one is now filled up with random numbers. How can i change all random numbers within a script? The reason why: I would like to make a shuffle button so the sort would be different everytime i push this button.

Is there a way to create this solution?

 

Many thanks

 

Jorgen

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use