Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hi,
I'm not a developer and pretty new to Thingworx.
I'm currently looking at how I could calculate First Pass Yield (FPY) of the tested units data.
FPY= total TestResult=Pass / Total entries based on filters applied.
I'm taking the data from a DataTable through "GetDataTableEntries" for the filter widget DataFilter. Possible filters would be: StationName, Product Type, TimeFrame, Operator...
But how can I write a service/query to allow calculation of FPY in my mashup, based on filters?
Or is there a better way to do that?
Thanks a lot for your help,
I probably would use a custom service to calculate FPY
So
1. A service to bring in the data, probably QueryDataTableEntries
2. A service to calculate the FPY
QueryDataTableEntries would display data in a grid and be bound to the data filter
The data filter query would be an input parameter bound to both QueryDataTableEntries and my calculate FPY service
Within my FPY calculation service I would use that query and server side QueryDataTableEntries to get the proper records, then I would use InfoTable functions to calculate final FPY and return that as a number to display on the mashup.
You can get 'fancy' by temporarily caching the raw data set so that you won't have to call it twice (once for display and once for calculation)
Look for a service called Aggregate that should allow you to get the COUNT of passed vs. fail and you can .length or GetRowCount to get total test results from the infotable.
Thanks PaiChung!
Appreciate your help.