Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I need to show a column in a Pivot Table wich counts some rows depending on a condition:
the formula is: Count(Distinct {$<[$(variable1)+$(variable2)]= {'>0'}>} [CommercialSite])
So I want to count comercial sites that variable1 greater than 0 and variable2 greater than 0. This sentence is not working because is counting all rows as if no condition is set.
I have checked the syntax and for me is ok, Can anybody help me with this?
Thank you very much.
Hi,
this works for the total sum > 0.
But if one of the parts is < 0 and the other is > 0 but the total sum is < 0 it does not return correct value.
Your original formula with or works also in this case.
This is probably nitpicking but it could be problem in case they have returns or credit notes.
Matus
That is true
Thanks for pointing that out.
UPDATE: Assuming there are no negative numbers in play, my expression might work
Hi,
No negative numbers, but still doesn't work. I've found a way for it to work:
Count(Distinct {$<[FIELD1]= {'>0'} > + $<[FIELD2]= {'>0'} >} [CommercialSite])
But only fields, not variables.
Thanks.
Try this:
Count(Distinct {$<CommercialSite = {"=[FIELD1] > 0 or [FIELD2] > 0"}>} [CommercialSite])
Hi,
When field1 or field2 is zero is not counting.
Can you copy paste the exact definition of the variable?
Have a look at this - I replaced the $ with @ in the header so that the variables are not parsed
The variables are defined as
Set variable1 = 'Sum(Sales1)';
Set variable2 = 'Sum(Sales2)';
Matus, can you please type the final sentence?
It is in the header of the 3rd column - you just need to change @ to $.
Sorry about the question, but when i use $ and @?