Hello all,
I am currently struggling with displaying data as an integer that is being pulled via a query. I have created a view where I use the following script to sum up the total value of that platform so I can display it in several textboxes, one for each of the platforms. I run this script from a dropdown filter set to current day (unless modified):
#Variables for table filter
date = self.props.value
shift = self.getSibling("Shift").props.value
dateStart = self.custom.filterDate
dateEnd = self.custom.filterEndTime
#Filter the table on startup
if date != None and shift != "":
#Fill compact totals
returnedData = system.db.runNamedQuery("Totals/Compact", {"dateStart" :dateStart, "dateEnd" :dateEnd, "shift" :shift})
self.parent.getChild("Body Box").getChild("Units Box").getChild("Compact Units").props.text = returnedData
#Fill FSOU totals
returnedData1 = system.db.runNamedQuery("Totals/FSOU", {"dateStart" :dateStart, "dateEnd" :dateEnd, "shift" :shift})
self.parent.getChild("Body Box").getChild("Units Box").getChild("FSOU Units").props.text = returnedData1
#Fill horizon front totals
returnedData2 = system.db.runNamedQuery("Totals/Horizon Front", {"dateStart" :dateStart, "dateEnd" :dateEnd, "shift" :shift})
self.parent.getChild("Body Box").getChild("Units Box").getChild("Horizon Front Units").props.text = returnedData2
#Fill horizon rear totals
returnedData3 = system.db.runNamedQuery("Totals/Horizon Rear", {"dateStart" :dateStart, "dateEnd" :dateEnd, "shift" :shift})
self.parent.getChild("Body Box").getChild("Units Box").getChild("Horizon Rear Units").props.text = returnedData3
#Fill VMAX totals
returnedData4 = system.db.runNamedQuery("Totals/VMAX", {"dateStart" :dateStart, "dateEnd" :dateEnd, "shift" :shift})
self.parent.getChild("Body Box").getChild("Units Box").getChild("VMAX Units").props.text = returnedData4
#Fill VMW classic totals
returnedData5 = system.db.runNamedQuery("Totals/VMW Classic", {"dateStart" :dateStart, "dateEnd" :dateEnd, "shift" :shift})
self.parent.getChild("Body Box").getChild("Units Box").getChild("VMW Classic Units").props.text = returnedData5
#Fill VMW HE totals
returnedData6 = system.db.runNamedQuery("Totals/VMW HE", {"dateStart" :dateStart, "dateEnd" :dateEnd, "shift" :shift})
self.parent.getChild("Body Box").getChild("Units Box").getChild("VMW HE Units").props.text = returnedData6
#Fill Total
returnedData7 = system.db.runNamedQuery("Totals/Total Units", {"dateStart" :dateStart, "dateEnd" :dateEnd, "shift" :shift})
self.parent.getChild("Body Box").getChild("Units Box").getChild("Total Units").props.text = returnedData7
This sets the textboxes to an array (as it is pulled from a query). For example: for today's date, I have [{"":2}] for the unit value for the "Compact" platform. Is there any way to get this to display the 2 without the additional array info?
Thanks in advance.