I have checked your siddhi query, it is working properly with siddhi engine and there is no any issue with the query...
I have checked with the KPI analyser example, it is also working without any issue for your query... Please make sure whether you have proper configurations for output tuple mappings..
Again I need to mention, there are some issue with the "bucket editable UI". Please verify the bucket xml file which in the /repository/deployment/server/cepbuckets/ is correct... (some times when deleting a property, it will not delete properly)
Change
<property name="quantity" valueOf="quantitySum" type="java.lang.Long"/>
<property name="purchasePrice" valueOf="totalpriceSum" type="java.lang.Long"/>
Thanks,
Mohan