Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
danialier
Creator III
Creator III

Market Share calculation

Hello,

I want a List Box to show the market share of different companies based on the country I select in a Text Box. The formula I use is the following one but it does not work... Please help.

  =num(sum({<Company=>}units))/num(sum(units))

thks,dani

Labels (1)
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I assume that there is an association between country and company? I would put Country in a list box and show the market share in a pivot or straight table.

Is the market share by country, or for all countries?

Your expression will be something like (share by country):

     =Sum(units) / Sum(Total Units)

or (share for all countries)

     =Sum(units) / Sum({<Country=>}Total Units)

The num() function does nothing in these expressions, it just changes the display format of the number.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

6 Replies
MK_QSL
MVP
MVP

SUM({<Company = >}units)/sum({1}units)

or

NUM(SUM({<Company = >}units)/sum({1}units),'#,##0.00%')

hic
Former Employee
Former Employee

Not sure what you really want... A list box does normally not show a calculation and you cannot make a selection in a text box.

But - If you show the market shares in a chart where you have Companies as dimension, you can calculate the market shares through

  Sum(units) / Sum(total units)

HIC

maxgro
MVP
MVP

perhaps you want the market share in a chart

and you select the country in a listbox?

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I assume that there is an association between country and company? I would put Country in a list box and show the market share in a pivot or straight table.

Is the market share by country, or for all countries?

Your expression will be something like (share by country):

     =Sum(units) / Sum(Total Units)

or (share for all countries)

     =Sum(units) / Sum({<Country=>}Total Units)

The num() function does nothing in these expressions, it just changes the display format of the number.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
bgerchikov
Partner - Creator III
Partner - Creator III

Hi Dani,

Try this one:

SUM(units)/SUM(TOTAL <Country> units)

Hope it will help

its_anandrjs
Champion III
Champion III

Hi,

Create a chart based on the Market share and display that one and use list box for country and other selection would be better idea.

Use expression like

=num(sum(units)) / num(sum(Total units))

Thanks & Regards