Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Try this:

=

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

View solution in original post

7 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try this.

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

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

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)

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Kindly upload QVW file with some example data.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

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

Regards,

Michael

Anonymous
Not applicable
Author

Hi,

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

There's an exemples attacched.

Regards,

Anonymous
Not applicable
Author

Try this:

=

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

Anonymous
Not applicable
Author

Thanks,

work fine !!