Qlik Community

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
Highlighted
ivanoski
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)
2 Solutions

Accepted Solutions
Highlighted

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)

View solution in original post

Highlighted

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)

View solution in original post

7 Replies
Highlighted

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)

View solution in original post

Highlighted
JGMDataAnalysis
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
ivanoski
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
ivanoski
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

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)

View solution in original post

Highlighted
JGMDataAnalysis
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]
)

 

ivanoski
New Contributor II

Re: Counting clients according to their purchases

Genius!