LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DataFinder Merge Queries Or

Solved!
Go to solution

I am using the DataFinder toolkit and am trying to setup a search where reports will be found that have a cycle count greater then some value.  For different report types the property of the file is named slightly different and I want to be able to find all of them.  So for instance if the test is a functional test then the name of the property is "Functional_Cycles_Completed", if the test is a continuous it is named "Continuous_Cycles_Completed", and some tests will contain both properties because some tests go back and forth between fucntional and continuous.

 

So some files have one property, some files have a different property, and some files have both properties.  I made a search query as a test that only looks for the continuous type being numeric and greater then 0.  It returned the files I wanted.  So next I made two queries, one for each property, then put them into an array with the bundle, and then to the Merge Queries using the OR operator.  Now my search returns no files.  Why is this?  There is no errors from the queries, merge, or search.

 

The only thing I can think of is that the merge fails because files don't contain both properties.  I am performing a search saying X > 0 OR Y > 0.  But if there is no Y does this cause the problem?  How can I perform a search looking for either property, but one may not exist?

0 Kudos
Message 1 of 10
(3,090 Views)

Okay because I want to prove I'm not crazy here is the VI I used to test with, and a video showing the results.  Saved in 2012 SP1.

 

http://screencast.com/t/NpwMotolWBij

 

But oddly enough when I tested it on another computer the results were what I expted.  Does this mean that there could be something wrong with my database?

0 Kudos
Message 2 of 10
(3,083 Views)

Hi Hooovahh,

if you have a file with property A and another file with property B and you search for A>1 OR B >1 the query should return both files.
The query you created looks good and should return all files where at least one of the three properties is contained and its value is equal to 0.

 

Are the properties you are using in your query optimized? Is there a different optimization status on the other computer you tested with?

To get a list of all custom properties and their optimization status click right on the DataFinder tray icon and select "Optimize Custom Properties...".


Have you tried to run each condition individually and not only the last one? Do all three queries return the expected search results?

 

Have a nice day,

Eva

0 Kudos
Message 3 of 10
(3,038 Views)

Thanks for the reply, I was worried I wouldn't get a response.

 

After some more testing I think I found a bug with DataFinder but this maybe just something I didn't see in the documentation.  If I search on A > 1, or B > 1, or C > 1, but my index hasn't found any files that even contain the property A then my results will always be 0.

 

Attached is an example.  Create an index where only these 6 TDMS files are indexed.  It contains two files where Functional_Cycles_Completed is 10 and 4 files where Continuous_Monitoring_Cycles_Completed is 20.  Note that none of these files have the 3rd type we are searching on which was Cycles_Complete.  Open the VI and check the boolean to search for Functional, and Continuous > than 0, you will get a result of all 6 files.  Searching just Functional, and just Continuous works fine returning 2 or 4 depending on which was searched.  But as soon as you add the Search Cycles in the mix it will always return 0.  Is there a work around other then to always have at least one file for each property we are searching?  Thanks.

0 Kudos
Message 4 of 10
(3,023 Views)
Solution
Accepted by topic author Hooovahh

Your response explains why you do not receive any results when you combine the three query conditions.

As soon as you use a property in your query which is not indexed the DataFinder returns 0 results.

 

There is a work around if you want to write some code which works even if a certain property is not indexed yet (but will probably be indexed later). You can use the Get Indexed Properties.vi to check whether a certain property is already indexed before you merge it with the other query conditions.

I attached an example VI which assumes that one property is always indexed and the other one may be not. I hope this helps.

 

Have a nice day,

Eva

Message 5 of 10
(3,003 Views)

Thank you for your help and the work around.  Can you do some more explaining on how this isn't a bug?  Or why it is done this way?

 

If I ask how many apples are in your right hand, and you say 5.  Then I ask how many apples are in both of your hands, and you have no left hand, should you answer with 0?  And there is no error indicating that the result may contain errors.

0 Kudos
Message 6 of 10
(2,992 Views)

Hi Hooovahh,

the question is always the same: what is an error and how should it be presented to the user?

Considering an apple plantation it is possible to ask something about apples, but what should be returned in case someone asks for boats - should the answer be zero with no error? or an error, but no results?
We decided for the error to provide a hint back to the user, why the answer is zero.

Translating it back to DataFinder: It is only possible to use know properties (either being know by indexing or default) in queries. Once unknown properties are used, an error is returned.

Greetings from sunny Aachen
Stefan

0 Kudos
Message 7 of 10
(2,951 Views)

Please disregard my prevous post - I'm wrong.

 

Currently no error will be thrown in case the porperty is not known to DataFinder, zero results will be returned.

 

Stefan

0 Kudos
Message 8 of 10
(2,943 Views)

@StefanR wrote:

Please disregard my prevous post - I'm wrong.

 

Currently no error will be thrown in case the porperty is not known to DataFinder, zero results will be returned.


Right, so how is this not a bug needing a CAR?

 

Also I don't think you fully understand my complaint.  So I'll use your example.  At an apple plantation I ask how apples or boats are there?  Should you answer 0?  No there are tons of apples and the comparision is an OR.  Even you don't know what a boat is you do know what an apple is and should include results that contain apples.  

 

A compromise would be to thorw and error letting the developer try to figure out why there are 0 results.

0 Kudos
Message 9 of 10
(2,933 Views)

Hi Hoovahh,

 

we are going for the compromise....

 

We have looked into this and envision a solution which will return an error at the time the query is executed. The error will contain the information that there is at least one unknown property used within your conditions.

0 Kudos
Message 10 of 10
(2,914 Views)