Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ivanoski
Contributor III
Contributor III

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
sunny_talwar

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

sunny_talwar

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
sunny_talwar

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)
JGMDataAnalysis
Creator III
Creator III

Try this...

COUNT(
      {<
        [CUSTOMER_ID] = {"=(SUM({<[BRANDS] = {'Michael Kors'}, [YEAR] = {$(vAñoMax)}>} [NETSALES]) / SUM({<[BRANDS] =, [YEAR] = {$(vAñoMax)}>} [NETSALES])) > 0.5"}
      >}
        DISTINCT [CUSTOMER_ID]
)
ivanoski
Contributor III
Contributor III
Author

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.

ivanoski
Contributor III
Contributor III
Author

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
sunny_talwar

This

=Sum({<CUSTOMER_ID = {"=Sum({<BRANDS = {'Michael Kors'}, YEAR = {$(vAñoMax)}>} NETSALES)/Sum({<YEAR = {$(vAñoMax)}>} NETSALES) > 0.5"}>} NETSALES)
JGMDataAnalysis
Creator III
Creator III

 

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

 

ivanoski
Contributor III
Contributor III
Author

Genius!