Windchill Fundamentals > Windchill Search > Search Reference > Search Range and Base Unit Conversion
  
Search Range and Base Unit Conversion
When performing attribute searches for Real Number and Real Number with Unit values, Windchill allows a certain range when returning search results. For more information, see Search Range for Numbers.
When searching for Real Number with Unit values, the range is calculated using the base unit. This unit might be different than your display unit, which can be controlled by user preferences. For more information, see:
Base Measures and Units
Displaying Attribute Values with Units
This can cause dramatic differences in search results depending on your display units. It can also cause confusion when users are sharing data but have configured their environment to use different measurement systems.
For example, consider the following:
User “John” has his display units set to USCS. When he creates or searches for parts, he assigns weight as lbs-mass (pounds).
User “Arnold” has his display units set to SI. When he creates or searches for parts, he assigns weight as kg (kilograms)
In Windchill, the base unit for weight (mass) is kilograms.
John and Arnold both work within the same organization sharing data.
Arnold creates the following parts and sets the weight of each in kilograms:
Name
Weight
Arnold_1
0.317515 kg
Arnold_2
0.317548 kg
Arnold_3
0.317562 kg
Arnold_4
0.318 kg
Arnold_5
0.3 kg
Arnold_6
0.3401987 kg
John creates the following parts and sets the weight in pounds:
Name
Weight
John_1
0.7 lbs-mass
John_2
0.67 lbs-mass
John_3
0.73 lbs-mass
John_4
0.69 lbs-mass
John_5
0.71 lbs-mass
John_6
0.70 lbs-mass
Display Units vs. Base Units
When John looks at Arnold’s parts, he sees their weights as kilograms converted to pounds.
However, the weight that is actually recorded in the database is the weight in base units. Since Arnold’s display units are the same as the base units, the weights he enters are identical to the values saved in the database.
Name
Weight Entered by Arnold
Display Weight for John
Weight Saved in Database
Arnold_1
0.317515 kg
0.700001 lbs-mass
0.317515 kg
Arnold_2
0.317548 kg
0.7000003 lbs-mass
0.317548 kg
Arnold_3
0.317562 kg
0.7000034 lbs-mass
0.317562 kg
Arnold_4
0.318 kg
0.701 lbs-mass
0.318 kg
Arnold_5
0.3 kg
0.7 lbs-mass
0.3 kg
Arnold_6
0.3401987 kg
0.7500097 lbs-mass
0.3401987 kg
However, from Arnold’s side, things are a little more complicated. When John enters a weight value in pounds, two things happen:
Windchill converts the input value to its pure base unit and saves the result to the database. For weight, this is kilograms, with a conversion rate of 1 pound to 0.45359237 kilograms. Therefore, 0.7 pounds is recorded in the database as 0.317514659 kilograms.
The converted weight is rounded to however many significant digits John entered when providing his input in pounds. This rounded amount is what is displayed in the interface (on information pages, in tables, and so on).
Therefore, what Arnold sees is likely different than the actual value saved in the database.
Name
Weight Entered by John
Display Weight for Arnold
Weight Saved in Database
John_1
0.7 lbs-mass
0.3 kg
0.317514659 kg
John_2
0.67 lbs-mass
0.30 kg
0.3039068879 kg
John_3
0.73 lbs-mass
0.33 kg
0.3311224301 kg
John_4
0.69 lbs-mass
0.31 kg
0.3129787353 kg
John_5
0.71 lbs-mass
0.32 kg
0.3220505827 kg
John_6
0.70 lbs-mass
0.32 kg
0.317514659 kg
* 
When rounding converted unit values to their display values, traditional rounding rules apply. For example. 0.25 rounds to 0.3. This is different than rounding in search ranges.
Example: Searching with Non-Base Units
When John performs advanced searches against the Weight attribute, the numeric range of his results is calculated from their converted equivalents.
For example, John performs a database search against the Weight attribute using a criteria value of 0.70 lbs-mass:
When he clicks Search, the following occurs:
1. Windchill takes the input value and converts it to the base unit value rounded to however many significant digits are provided in the search input. This is the same kind of rounding described earlier when determining the converted display units that Arnold sees. For example:
Full converted value = 0.317514659 kg
An input of 0.7 lbs-mass is rounded to 0.3 kg
An input of 0.70 lbs-mass is rounded to 0.32 kg
An input of 0.700 lbs-mass is rounded to 0.318 kg
2. The search range is determined based on the converted and rounded base unit:
0.70 lbs-mass = 0.32 kg
0.32 kg = Search range of 0.315 to 0.325 kg (inclusive)
3. When the search results are returned to John, the weights are displayed in their USCS value. The applied search range of 0.315 to 0.325 kg returns a display range of 0.69445612588 to 0.7165023521 lbs-mass.
* 
This difference is important. If the base unit was pounds and no conversion was taking place, John could expect the search to return a much smaller range of 0.795 to 0.705 pounds.
John’s search returns the following:
Name
Display Weight
John_1
0.7 lbs-mass
John_5
0.71 lbs-mass
* 
This part would not have been returned if no base unit conversion had taken place, as it falls outside the range of 0.795 to 0.705.
John_6
0.70 lbs-mass
Arnold_1
0.700001 lbs-mass
Arnold_2
0.7000003 lbs-mass
Arnold_3
0.7000034 lbs-mass
Arnold_4
0.701 lbs-mass
Example: Searching with Base Units Against Converted Data Values
Now Arnold searches for parts using the criteria Weight=0.317514659kg (this is the full Windchill conversion for 0.70 pounds).
No conversion occurs before the search executes. As a result, Arnold returns a much smaller range of 0.3175146585 to 0.3175146605:
Name
Display Weight
John_1
0.3 kg
John_6
0.32 kg
At this point Arnold might rightfully be confused:
Why did his search return John_1 but not Arnold_5? When he looks at their information, they both have the same weight: 0.3 kg.
And why did his search return John_6, but not John_5? When he looks at their information, they also have the same weight: 0.32 kg.
The answer is that Windchill searches against the database value, not the display value:
Name
Display Weight for Arnold
Weight Saved in Database
John_1
0.3 kg
0.317514659 kg
John_2
0.30 kg
0.3039068879 kg
John_3
0.33 kg
0.3311224301 kg
John_4
0.31 kg
0.3129787353 kg
John_5
0.32 kg
0.3220505827 kg
John_6
0.32 kg
0.317514659 kg
Both John_1 and John_6 have a database value that exactly matches the search input. However, the true database value of John_5 does not fit in the search range.
As for Arnold_5, its display value and database value are the same: 0.3 kg. Therefore, when evaluated for this search, Arnold_5 is rounded to 0.300000000, which is not within the search range of 0.3175146585 to 0.3175146605.