# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
New Contributor II

## Counting clients according to their purchases

=COUNT({<{((SUM({<BRANDS={

'Michael Kors'

}, YEAR={\$(vAñoMax)}>} NETSALES))/(SUM({<YEAR={\$(vAñoMax)}>} NETSALES)))>0.5}>
}DISTINCT CUSTOMER_ID)

I am trying to count the number of clients whose total purchases of a brand are greater than 50% of their total purchases so far. but this formula I made does not work, I need help trying to figure this out.

Labels (3)

• ### total sales

2 Solutions

Accepted Solutions
Highlighted
MVP

## Re: Counting clients according to their purchases

May be try this

``=Count(DISTINCT {<CUSTOMER_ID = {"=Sum({<BRANDS = {'Michael Kors'}, YEAR = {\$(vAñoMax)}>} NETSALES)/Sum({<YEAR = {\$(vAñoMax)}>} NETSALES) > 0.5"}>} CUSTOMER_ID)``
Highlighted
MVP

## Re: Counting clients according to their purchases

This

``=Sum({<CUSTOMER_ID = {"=Sum({<BRANDS = {'Michael Kors'}, YEAR = {\$(vAñoMax)}>} NETSALES)/Sum({<YEAR = {\$(vAñoMax)}>} NETSALES) > 0.5"}>} NETSALES)``
7 Replies
Highlighted
MVP

## Re: Counting clients according to their purchases

May be try this

``=Count(DISTINCT {<CUSTOMER_ID = {"=Sum({<BRANDS = {'Michael Kors'}, YEAR = {\$(vAñoMax)}>} NETSALES)/Sum({<YEAR = {\$(vAñoMax)}>} NETSALES) > 0.5"}>} CUSTOMER_ID)``
Highlighted
Contributor II

## Re: Counting clients according to their purchases

Try this...

``````COUNT(
{<
[CUSTOMER_ID] = {"=(SUM({<[BRANDS] = {'Michael Kors'}, [YEAR] = {\$(vAñoMax)}>} [NETSALES]) / SUM({<[BRANDS] =, [YEAR] = {\$(vAñoMax)}>} [NETSALES])) > 0.5"}
>}
DISTINCT [CUSTOMER_ID]
)``````
Highlighted
New Contributor II

## Re: Counting clients according to their purchases

A thouthand thanks, another mistake i was doing is apparently qliksense didn´t like the way i was spacing things, i removed the spaces and it worked.

Highlighted
New Contributor II

## Re: Counting clients according to their purchases

How do I show the NETSALES of the result of that formula? in other words, the net sales of the customers that resulted from that formula, just a total
Highlighted
MVP

## Re: Counting clients according to their purchases

This

``=Sum({<CUSTOMER_ID = {"=Sum({<BRANDS = {'Michael Kors'}, YEAR = {\$(vAñoMax)}>} NETSALES)/Sum({<YEAR = {\$(vAñoMax)}>} NETSALES) > 0.5"}>} NETSALES)``
Highlighted
Contributor II

## Re: Counting clients according to their purchases

``````SUM(
{<
[CUSTOMER_ID] = {"=(SUM({<[BRANDS] = {'Michael Kors'}, [YEAR] = {\$(vAñoMax)}>} [NETSALES]) / SUM({<[BRANDS] =, [YEAR] = {\$(vAñoMax)}>} [NETSALES])) > 0.5"}
>}
[NETSALES]
)``````

Highlighted
New Contributor II

Genius!