Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone!
Thank you so much for taking the time to read my question and potentially answer it!
I am still trying to figure out set analysis; is there a way that you can have an equation within the expression that then removes certain values?
For instance, if I have the following columns (Fruit, Veggie, CountofFruit,) and only want to sum the CountOfFruit when the veggie field is populated, how would I do that?
Fruit Veggie CountofFruit
Apple 10
Apple Carrot 5
Pear Lettuce 12
Pear 1
So I want to return the value 17 (from 5+12). Would the following equation work? And if not, what else could I do to be able tot do this?
=sum( {<len(veggie) = {">0"} >} CountofFruit)
Thanks!
I would create a flag in the script to handle this
LOAD Fruit,
Veggie,
If(Len(Trim(Veggie)) = 0, 0, 1) as Flag
CountofFruit
FROM ....;
and then this:
=Sum({<Flag = {1} >} CountofFruit)
Or May be front end
Sum({<Veggie -= {''}>}CountofFruit)
Or
Sum({<Veggie = {'*'}-{''}>}CountofFruit)