7 Replies Latest reply: Apr 19, 2013 10:48 AM by Dario Valsecchi

# Count Distinct Client buying >xx units in the current quarter ...

We have to count the customers who bought more than xx units of products in the current quarter.

The count must be independent from the filters on time but depend on all other selections.

we start to write this:

=Count({\$<Year=,Quarter=,Month=,Is_CurrentQuarter={'1'}>}DISTINCT CodCli)

We haven't idea how to write the condition on quantity..

Can anyone help us?

• ###### Re: Count Distinct Client buying >xx units in the current quarter ...

Hi,

Try this.

=Count({\$<Year=,Quarter=,Month=,Is_CurrentQuarter={'1'},CodCli = {'=sum(Unit) > 100'}>}DISTINCT CodCli)

Regards,

Kaushik Solanki

• ###### Re: Count Distinct Client buying >xx units in the current quarter ...

Hi Kaushik,

we have alredy tried to write this, with a variable for quantity (because the quantity can be setted from the user), but don't work fine, the client count is changing on time selection.

=Count({\$<Year=,Quarter=,Month=,Is_CurrentQuarter={'1'},CodCli={'=sum([Qta])>=\$(v_Target)'}>} DISTINCT CodCli)

• ###### Re: Count Distinct Client buying >xx units in the current quarter ...

Hi,

Kindly upload QVW file with some example data.

Regards,

Kaushik Solanki

• ###### Re: Count Distinct Client buying >xx units in the current quarter ...

I think you need time conditions (Year=, etc) in the sum itself.  Now the sum(Qta) is changing according to selections.

Regards,

Michael

• ###### Re: Count Distinct Client buying >xx units in the current quarter ...

Hi,

me too i think that the sum must be changed (but how?)

There's an exemples attacched.

Regards,

• ###### Re: Count Distinct Client buying >xx units in the current quarter ...

Try this:

=

Count({\$<Year=,Quarter=,Month=,Is_CurrentQuarter={'1'},CodCli={'=sum({\$<Year=,Quarter=,Month=>}[Qta])>=\$(v_Target)'}>} DISTINCT CodCli)

• ###### Re: Count Distinct Client buying >xx units in the current quarter ...

Thanks,

work fine !!