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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Not able to calculate Market Share

Hi All, I am trying to calculate Market share with the below expression = if ( SubMetric = 'Volume', sum(Volume), if( SubMetric = 'Market Share', (round(sum(Volume)) / round(sum({$}Volume))))) But it is giving me 100%. Please suggest. Regards, Manish Virmani

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Then play with qualifiers on the total:

... TOTAL <Brand> Volume)

... TOTAL <Week> Volume)

to get the results you require.

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

View solution in original post

14 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

= if ( SubMetric = 'Volume', sum(Volume),

  if( SubMetric = 'Market Share',

  (round(sum(Volume)) / round(sum({$<Brand = >} TOTAL Volume)))))

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

Hi Jonathan, Thank you for your response. By this it is giving the sum of total volume ignoring the Week. As i am showing the week on X axis so we need to have the week wise value. Regards, Manish Virmani

jonathandienst
Partner - Champion III
Partner - Champion III

Then play with qualifiers on the total:

... TOTAL <Brand> Volume)

... TOTAL <Week> Volume)

to get the results you require.

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

Try TOTAL <week> kind of to define the dimension of Total.

Not applicable
Author

Hi Digvijay, Please explain a bit more. I have very little knowledge of qlikview. Regards, manish virmani

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this expression

= if ( SubMetric = 'Volume', sum(Volume),

  if( SubMetric = 'Market Share',

  (round(sum(Volume)) / round(sum({$<Brand = >} TOTAL <period>Volume)))))

Note: TOTAL <period> will ignore the Brand dimension and get the total by period.

Hope it helps you.

Regards,

Jagan.

Not applicable
Author

Thanks you Jagan, Jonathan and Digvijay. Regards, manish virmani

Not applicable
Author

Hi Jagan, In my actual data set i have columns like Periodicity (have value like Weekly/ Monthly) and period (have value like Week1,Week2.. / Month1,Month2..) When in Periodicity Weekly is selected value in 'period' will show Week1,Week2.. when in Periodicity Monthly is selected value in 'period' will show Month1, Month2.. But using the expression gives all the values where period is month also (round(sum(Volume)) / round(sum({$} TOTAL Volume))))) Regards, Manish Virmani

jagan
Partner - Champion III
Partner - Champion III

Hi Manish,

There is no Monthly value in Period filter, also you are not using TOTAL <period> in the expression.  Can you update the file and let us know your expected output for the selections then it would be easier to give the solution.

Regards,

Jagan.