4 Replies Latest reply: Jun 20, 2016 7:14 AM by Stefan Wühl

# SET ANALYSIS: COUNT DISTRIBUTION PRODUCT

Hello all,

I am having difficulties when obtaining a result in a formula. The main problem is that I would like to obtain the distribution of a product"x" throught in a store taking into account all the visits to that store.

Please find attach a sample of my problem.

 STORE VISIT DATE PRODUCT "X" A 20151030 IN STORE A 20160129 IN STORE A 20160222 NOT IN STORE A 20160303 NOT IN STORE A 20160314 NOT IN STORE A 20160404 NOT IN STORE A 20160421 NOT IN STORE

Basically I would like to obtain in the formula  2/7 when calculating the product distribution, but I am obtaining 2/2 and I have to get a 7 in the denomitaor, counting all the visits.

The denominator formula I am using is the next one:

sum(aggr( count( distinct STORE), \$(= GetCurrentField(Product)),STORE,VISIT DATE))  being (Product)) a ciclic group where I have different charasteristics of the product.

Could you please give any tip or advise about how this formula could work in order to take into account all the visit in the denominator?

• ###### Re: SET ANALYSIS: COUNT DISTRIBUTION PRODUCT

Perhaps like this:

Count({<[PRODUCT "X"]={'IN STORE'}>} total <STORE> STORE) / Count({<[PRODUCT "X"]={'NOT IN STORE'}>} total <STORE> STORE)

• ###### Re: SET ANALYSIS: COUNT DISTRIBUTION PRODUCT

Context is important to any expression, and it's not quite clear which chart dimensions are used and how all these fields are related in your model.

I would assume that you should be able to get what you need using the TOTAL qualifier, maybe like

=Count(TOTAL<STORE> DISTINCT [VISIT DATE])

Maybe you need a more complex expression, but without knowing the full context, that's hard to answer.

• ###### Re: SET ANALYSIS: COUNT DISTRIBUTION PRODUCT

Hello!

Thanks for your answer! It really works but when I select the product, the denominator turns out =2, so the denominator only takes into account the store-date when the product is in the store and I would like to have a 7.

Thanks!

• ###### Re: SET ANALYSIS: COUNT DISTRIBUTION PRODUCT

If you need to ignore selections in product field, you can use set analysis, something like

=Count({<PRODUCT=>} TOTAL<STORE> DISTINCT [VISIT DATE])

or to ignore any selections:

=Count({1} TOTAL<STORE> DISTINCT [VISIT DATE])