Discussion Board for collaboration related to QlikView App Development.
i have this pivot;
dimension: material
expression : MAX(quantity),SUM(safetystock),[quality]-[safetystock]
i want to put the count on the results where quality-safetystock < 0 into a textbox.
So i want in a textbox how many materials are below safetystock.
how does this expression look like?
SUM(IF(AGGR((MAX([Quantity]) - SUM([SafetyStock])),[MaterialID]) < 0,1))
Hello Amien,
Not sure if I understood you right (I'm assuming the labels are respective to the Max() and Sum() function), but if that returns more than one line, use better a straight table without dimensions with something like the following:
Count({< ID = {"=Max(quantity)", "=Sum(quality - safetystock) < 0"} >} ID)
Hope that helps.
BI Consultant
Thanks for your reply..
Yes those are the labels of max() and sum()
only your formula doesn't give me the end result that i need.
If i have this in an expression:
IF(MAX(Quantity) - SUM(SafetyStock) < 0,1,0)
i need the sum of that (all the '1') into a single textbox
Hi,
Then try something like
Count({< ID = {"=Max(Quantity) - Sum(SafetyStock) > 0"} >} ID)
I'm using the "ID" as the field that identifies those Quantity and SafetyStock (Items maybe)?
Hope that helps.
BI Consultant
same result
btw ..
not items, but plants.
each plant has different quantities on each material (max)
i dont really need to see the plant
and each material has a needed safety stock which is only one per material (sum)
so the sum is not really needed cause all materials only have one safety stock
Dear Miguel,
i have added an example .. in my textbox/button .. i need the value '2' .. because 2 materials are below safetystock
SUM(IF(AGGR((MAX([Quantity]) - SUM([SafetyStock])),[MaterialID]) < 0,1))