Forum Discussion

Kent1341's avatar
Kent1341
Helper I
2 years ago
Solved

Getting a 1 in all rows.

Hi,

 

This is one that really puzzles me. 

 

I have a table with my sales and want to know how significant a portion that is not selling. The granularity that I have is one row per product per store. So I want to calculate divide(shops that have sold the product, Shops in total) per product. It is a "Yes/No" question. So have they sold anything the value is 1 and have they not sold anything the value is 0.

 

So far I have calculated the products that sell. 

My problem is to get to the "Shops Total". It is OK to get to the 1 and 0, but when it starts to calculate I get a wrong result. (See below). The result in the row with 18 should be (18/24) = 75% and not (18/18). 

 

The problem is that in weeks without any sales of a product, there are no rows in my table that have the combination (Store / Product), if there was a row it would have sales, so this is my problem. I force in a "1" for the blank, but when it has to make the sumups, there is no blank, and the calculation is done on the rows that have sales without looking at the ones that have no sales.

 

 

Can anyone help me with this one? How do I get a result of 24 and not 18 in this calculation?

 

Br Kent

5 Replies