# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Honored Contributor III

## YoY Market Share Calculation in qlik sense

hi all,

I am calculating market share formula using dimension Company & fiscal year

Expression:

(((SUM({\$<COMP=,FiscalYear={\$(=max(FiscalYear))}>} Y2Sale))/\$(vvTotalY2Sale))*100)

Variable Declared

vvTotalY2Sale is variable : SUM({\$<FiscalYear={\$(=max(FiscalYear))}>} TOTAL [Y2Sale])  (total of all Compaies)

I am getting output attached which is correct for one fiscal year 2018 , in my data I have data from 2011. How to show this all fiscal year market share like 2011.... to 2018 companywise?

Vikas

7 Replies
MVP

## Re: YoY Market Share Calculation in qlik sense

Remove the set analysis on Fiscal Year as this is what is restricting the expression to show 2018 only

(((SUM({\$<COMP>} Y2Sale))/\$(vvTotalY2Sale))*100)

Variable Declared

vvTotalY2Sale is variable : SUM( TOTAL <[FiscalYear]> [Y2Sale])

Honored Contributor III

## Re: YoY Market Share Calculation in qlik sense

Thanks Sunny

Hey Sunny i declared  vY2SaleYearly =SUM( TOTAL <[FiscalYear]> [Y2Sale])

used expression : (((SUM({\$<COMP>} Y2Sale))/\$(vY2SaleYearly))*100)  as you suggests

Dimension : FiscalYear & Comp

default selected : FY17-18

Still i am not able to get yearly trend in chart I wanted to calculate market share for each fiscal year like

2011  2012   2013 ....  2018 & Market share of each company

thanks

vikas

MVP

## Re: YoY Market Share Calculation in qlik sense

Have you made selection in a FiscalYear? Do you want me be deselect FiscalYear or ignore selection in FiscalYear in your expressions?

Honored Contributor III

## Re: YoY Market Share Calculation in qlik sense

I wanted to ignore fiscalyear in expression default  fiscal year will be selected by user.

Thanks

Vikas

MVP

## Re: YoY Market Share Calculation in qlik sense

Then try this

(((SUM({\$<COMP, [FiscalYear]>} Y2Sale))/\$(vvTotalY2Sale))*100)

Variable Declared

vvTotalY2Sale is variable : SUM( TOTAL <[FiscalYear]> {<[FiscalYear]>} [Y2Sale])

Honored Contributor III

## Re: YoY Market Share Calculation in qlik sense

Sunny tried this as well  I am getting only current fin year MS

Vikas

MVP

## Re: YoY Market Share Calculation in qlik sense

Is FiscalYear different from FinancialYear? You seem to be making selection in FinancialYear... may be try this

(((SUM({\$<COMP, [FiscalYear], FinancialYear>} Y2Sale))/\$(vvTotalY2Sale))*100)

Variable Declared

vvTotalY2Sale is variable : SUM( TOTAL <[FiscalYear]> {<[FiscalYear], FinancialYear>} [Y2Sale])