I am trying to use PI to calculate inventory of a product we make. The product inventory is not stored in any system. We know how much is made per day and how much we sold per day but not sure how to get the inventory into a tag. We currently use analysis in AF to calc the amount produced for yesterday and the same for amount sold. I know inventory is (Yesterdays inv amount + amount produced) - amount sold and I have this in analysis but how do I write this to a tag but keep the yesterday inv amount to use in the next days calculation?