You are viewing limited content. For full access, please sign in.

Question

Question

How to search for a number range??

asked on January 6, 2014

I have a customer that scans in check vouchers and they enter the Check # into the template field.  They'd now like to be able to go back and search for a range of checks (say checks 20001-20230) and have the results of those range of checks show up.  That is one request.  The other is to be able to say specifically, that they want to search for Check 20001, 20003, 19991, and 203301 all in 1 search without having to do multiple searches.  Can someone help me with how to create that search so that I can Save it for them so they can just load it?

 

Thanks!!

 

0 0

Answer

APPROVED ANSWER SELECTED ANSWER
replied on January 20, 2014

For the range search, if you are willing to use the advanced search syntax, the following worked for me even in a text field (as opposed to a number field, where this type of search is supported by the search UI):

({[]:[Check Number]>20001, [Check Number]<20230})

This syntax is searching for on the field Check Number for values greater 20001 AND less than 20230.

 

If you want to include results with the leading zeros:

({[]:[Check Number]>20004, [Check Number]<20230})|({[]:[Check Number]>000020004, [Check Number]<000020230})

To use to UI, something similar to what Kevin B suggested earlier works for me: if you want to search for checks between 20000 and 20230, search on *20[0-2][0-3][0-9], which gives you the leading zeros, then says the number should start with 20, and specifies the digits that can be used for the hundreds, tens, and ones.

1 0

Replies

replied on January 17, 2014

To search for a list of specific checks under the advanced search option, you can use the in search option:

{[]:[Check Number] in (20001,20003,19991,203301)}

 

Depending on the field type, you may have to use quotes ("), such as ("20001","20003").

2 0
replied on January 20, 2014

Kenny,

That works if I know all the check numbers...but what if I'm searching for a range?  The issue here is that the Field was initally setup as a Text field...so I can't just type in 0002001-0002020 and find all the checks in that range...any suggestions? (I'm looking into a workflow that will change all this, but we have a pretty complex workflow going on right now and want to make sure that changing the fields won't break everything else).

0 0
replied on January 21, 2014

If your number field is really a text value, that may break the range search options that have been provided.

 

I have had a few fields that were created this way. Assuming you want to keep the current field, I converted them by:

  1. Create dummy field with correct type (number)
  2. Create a simple workflow that finds all documents with a value in the original field and copy the value to the new field.
  3. In the admin console, change the field type of the original field. This wipes all the data out of the field. 
  4. Create a simple workflow to copy the data from the dummy field to the original field.

 

If you want to create a new field and remove the original field, then you can delete the original field in step 3 and you're done.

0 0
replied on January 6, 2014 Show version history

Not sure how to do such a specific search as that, but i have found a way to limit a search to certain numbers.

 

if you put the following into the field you can find anything between 20000 and say 20299

 

[2][0][0-2][0-9][0-9]

 

Edit: I guess [20001]-[20230] would work O_o...

 

not sure if you could make it more precise than that.

 

For the second one I am not sure how you would achieve that without using the Advance search settings and using OR values.

1 0
replied on January 6, 2014

You can simply type 20000-20230 in the field search and it will search the range.

 

I don't know of an OR operator in the field search but you could use an advanced search with an OR operator.

 

You could generate the search with a workflow or the syntax with a script.

 

{[]:[Check Number]>="20001"}|{[]:[Check Number]<="20003"}

1 0
replied on January 6, 2014 Show version history

if they are always loading the same search (like always check number 5) then it's a simple save of a search.

 

If it's always changing, then you need to show them how to modify a saved search in the advanced menu. You will need to use multiple

& {[]:[Check]="20001"} 

to accomplish the task you are asking about. 

 

 

Alternatively, you may be able to have them fill out a new document with a secondary metadata field that is multiple values and have them fill it with the check numbers you want and use workflow to generate the advanced search syntax and then email it to them.

 

You also can just link those documents to that entry they create, but that might get messy.

0 0
replied on January 13, 2014

So the customer is simply trying to search for a check range...the one we tried was searching for check #'s 285809-285820.  When we simply tried to type the range into the field...we found no results.  I also tried [285809]-[285820] and then got an error (see screenshot attachment).  The other issue we faced is that sometimes...the check number is preceded with 0000, and sometimes they are not...so I figured simply adding the * would account for that..but it didn't seem to make a difference.  The other thing that concerns me is that they may search for the range 285809-285820, but if 285820 doesn't exist...it provides "No Results Found" instead of providing the results that doe exist (finding the 10 that are there and just excluding the 1 that isn't).  Does this make sense what I'm trying to do?  Just need to know 1) Is it feasible 2) If so, how to accomplish it.

 

Thanks!

Capture.PNG
Capture.PNG (19.64 KB)
0 0
replied on January 16, 2014

Since you have leading zeroes in your field, I am assuming it is set up as a text field, not a number field. I would recommend using Advanced Search. First, make sure that advance search is open along with your template/field and run a search for the number before the first number in the range. The advanced search will display the syntax of the search you just ran. Click the box to enable advanced search and change the "=" to a >. Then copy that part and add it to the search string, with an AND in between (or &), change the number to the number after the last one and the < to a >.

 

Next, I would add an "OR" (or | ) and copy the whole part again this time add the leading zeroes to both numbers.

 

I think that would work - not in the office right now, so I can't test it.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.