DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Analysis Server, Python Calling DIAdem Functions to Search

Hello Group.

 

I am working with Analysis Server, In Python, and are working to develop code that will access Datafinder and Datafinder Server objects.

 

So far the function below, will run without errors. (You can change the properties you hare searching to fit your data file.) 

But it does not return any thing either, as I get oMyResults.Count = 0

Questions

1)  Am I structuring the commands for searching correctly?

2) Am having some issues with knowing what return type should come back from DIAdem, so that I can pull out the results?

 

If I can get this to return some really basic Property, then I can expand this to return more.  

 

Thanks as always for any help/guidance..

 

Paul

 

ps. Working with DIAdem 2018 64, Python 3.6.5.

 

 

 

def dfseGetTestID(oContext_,oDIAdem, sDataFinder_, sTestGUID):
"""
Queries DFSE or My Datafinder for what the Test ID is for a given TestGUID.
This is a prototype on larger queries that run from python AP
pes 2019Mar13
"""
oContext_.LogResult("eSearchChannel: "+str(oDIAdem.eSearchChannel))
oContext_.LogResult("eAdvancedQuery: "+str(oDIAdem.eAdvancedQuery))

oMyDataFinder = oDIAdem.Navigator.ConnectDataFinder(sDataFinder_)
oMyQuery = oMyDataFinder.CreateQuery(oDIAdem.eAdvancedQuery)
oMyQuery.ReturnType = oDIAdem.eSearchChannel

oMyConditions = oMyQuery.Conditions

oMyConditions.Add(oDIAdem.eSearchFile, "GUIDs~TestGUID", "=", sTestGUID)
#Call oMyConditions.Add(eSearchChannel,"maximum",">=","10")
oMyConditions.Logic = "C1"

oMyResultsColumn = oDIAdem.Navigator.ConnectDataFinder(sDataFinder_).CreateResultsColumns
#oMyResultsColumn = oMyDataFinder.CreateResultsColumns()

oMyResultsColumn.RemoveAll

oMyResultsColumn.Add(oDIAdem.eSearchFile, "GUIDs~TestGUID")
oMyDataFinder.SearchProperties(oMyQuery, oMyResultsColumn, 200)

# Note returning what expected in Result Properties.
# Needs more research to findout what is coming back from ResultProperties

oMyResults = oDIAdem.Navigator.ConnectDataFinder(sDataFinder_).ResultsProperties

oContext_.LogResult("oMyResults.count: "+ "{0}".format(oMyResults.Count))

#oContext_.LogResult(oContext_, "Type of oMyResults: "+ str(type(oMyResults))) # this is throwing error most likely becuased nothing was returned.

#sTestID1 = oMyResults.GetValuesBlock(1,1)
#sTestID = sTestID1(0)

return "sTestID"

 

 

 

Message 1 of 1
(2,328 Views)