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

Random Generator

Status
Not open for further replies.

Ohioste

Technical User
Apr 21, 2009
58
US
I'm trying assign empty locations in a random order to a list of SKUs.

I know how to eliminate locations that aren't empty and put it sequentially, but that would fill up one part too quick.

Is there a random generator? If you need more information, please let me know.

Thanks!
 
Yes, this is unclear. Maybe show a sample of how the report currently displays and then explain what you are trying to do.

-LB
 
The report we currently have shows where an item should be located in our building based on Sales and Forecast. I'd like to be able to randomly generate a location based on the tower and Loc Type.

This is the current format of the report:


SKU Desc. Tower Loc Type Min Max
1A56A56 Nothing 1 Bin 1 1 8


Our locations currently look like this:

Aisle: XXX Bay: XXX Level: X Position: XX

A sample location would be 1A2001A01

So Aisle is 1A2 so the first 1 tells us it's in tower 1.

Bay is 001, Level A, Position is 01.

I want to create a formula to say something along the lines that if Loc Type = 'Bin 1' then find a random location where Loc Type = 'Bin 1' and left(aisle,1) = '1'

It's easy to bring in a location, but it would bring them in numerically. By doing this, it would fill up one side of our pick mods before the other.

Is this even possible?

Let me know if you have any more questions.

Thanks for the help! It's much appreciated.



 
Well, it seems like you really want to add this new assigned location to the database, not just to a particular run of a report, and I'm not sure how you would go about that.

You can use the rnd() function to randomize a set of records. You would add the function just as is to a formula field, add the formula to your report, and then sort on the formula. Each time you refresh though, it will reorder the items. So you could use this to get the random assignments, but I'm not sure how you would go about building the results into your database, if that is your intent.

-LB
 
lbass,

Sorry...I got assigned to another project, so I'm kind of late getting back to this.

I'm not trying to update a database, just pull random locations and input them in the report.

These locations need to have a few "if" statements attached to them however.

So for example, if Loc Type = Bin 1, I need it to go into a database, look for all Bin 1 locations where the SKU = ' '.

I'm also having problems with getting a random location because our locations currently are in the format of 1A5006A01. Will the letter inhibit me from doing a random location.

Thanks!
 
The value of the location would have no impact on this. I think the easiest approach would be to insert a subreport that is linked to the main report on bin # and then add:

rnd()

...as a new formula in the sub. Add this formula as the sort field. Then add the location subreport header and suppress all other sub sections.

You realize, of course, that each time you refresh the report that a different location may/will appear since the randomization is not static.

-LB
 
Is it possible to link a formula in a subreport?

The report is currently determining the location size type for our team.
 
Also, when I create a subreport and try to do a simple rnd(location) I get an error saying a number is required.

When I try to do a rnd(tonumber(location)), it'll let me save the formula but when I try to run the report it says the string is non numeric.
 
Why wouldn't you simply link on bin#? If you place the sub either in a group section based on bin or in the detail row, it will return the correct result without using a conditional formula. If this isn't what you were referring to, please show the content of the formula and explain your rationale.

You should NOT be putting anything in the parens--the formula IS:

rnd()

You place this in the detail section and then add it as your sort field. Add the location field to the report header, and you will always get the random location that is the first value in the subreport.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top