Hi - this is somewhat of a two part question.
-
Is it not possible to reference the result of a named query inside an expression tag?
-
If not, I’ve attempted to generate a UDT that will allow me to provide the Named Query name in a Memory tag (string) and I have an expression tag using a series of
runScript()
withsystem.db.runNamedQuery()
.
The issue I am running into is that when I try to reference the sibling ‘NamedQueryName’ tag within my UDT definition, tag({PathToParentFolder} + "/NamedQueryName")
is returning -1
. However, if I use this same expression in a sibling expression tag, it returns the value of the corresponding sibling memory tag NamedQueryName
.
For those curious, my final expression is for my OutputValue
tag (which is a float) is: runScript("system.dataset.toPyDataSet(system.db.runNamedQuery('" +
tag({PathToParentFolder}+"/NamedQueryName")
+ "',{}))[0][0]")
(the bolded part is returning -1, but if I use that same expression in its own expression tag, it returns the appropriate value).
It is safe to say I already feel uncomfortable building out this custom python expression using runScript()
inside a tag, but I feel it is my only option.
Thank you
EDIT: I believe to have resolved my issue with the expression. It appears that the scope of the expression tag needs to have the project defined, which is understandable. However, I am still somewhat uncomfortable doing this via runScript(). I am looking to keep these queries only defined in one place as they are using in the reporting plugin too.