How to count average WITH zeros in LookML?

Hello! I didn’t find anything like this in other topics, but I really need to count average with zeros. 

F.ex. I have numbers 22, 22, 0, 44, 0. Type of measure “average” usually ignores zeros and basically counts 88/3. But what I need to do, it’s 88/5. I need to do this in LookML. Any ideas, please?

0 3 267
3 REPLIES 3

kuopaz
Participant IV

I think the average measure will already do what you want, i.e. include the zeros and do 88 / 5.

(If it was 22, 22, NULL, 44, NULL the NULLs would be ignored and hence 88 / 3.)

I think the average measure will already do what you want, i.e. include the zeros and do 88 / 5.

(If it was 22, 22, NULL, 44, NULL the NULLs would be ignored and hence 88 / 3.)

Yes, you are right. I noticed that all my other views counts zeros, but not this one, and that’s why I have this issue. And I have no idea why

Dawid
Participant V

Have a look at the generated SQL perhaps you have value formatting applied but the actual data is NULL

Top Labels in this Space
Top Solution Authors