Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Formula for summing a value of a dimension

Hi, I want to show the sum of a value of a dimension in a KPI. I have created the following hypothetical example to illustrate.

   

Sales
North956.376,34 €
South805.544,99 €
East686.844,42 €
West581.089,77 €
* Dimension: Sales
* North, South, East, West are dimensional values

   

North
John315.604,19 €
Bob191.275,27 €
Billy239.094,08 €
Lincoln210.402,79 €

* Breakdown of North

What would be the best way to show the total sum of all sales in North, i.e., 956.376,34 € in the front end? My formula is

sum(if(Type='ComponentCVaR',Type,null())) but it is not working...

Thank you.

Tags (1)
5 Replies
swuehl
Not applicable

Re: Formula for summing a value of a dimension

Since Type is a text value, you don't want to sum() this, right?

Try summing a numeric field.

MK_QSL
Not applicable

Re: Formula for summing a value of a dimension

What is Type here?

Not applicable

Re: Formula for summing a value of a dimension

Hello,

If Type is a text field it will not work.

You can try one of the following expressions (adapt according to your model):

  • Sum(if(Region = 'North', Sales))
  • Sum({<Region = {'North'}>} Sales)

Thanks,

Estela

phaneendra_kunc
Not applicable

Re: Formula for summing a value of a dimension

Assuming you have a Field called "Sales" in your data that has both text and number.

For dimension: =Capitalize(KeepChar(lower(Sales),'abcdefghijklmnopqrstuvwxyz€'))

For expression: =sum(PurgeChar(lower(Sales),'abcdefghijklmnopqrstuvwxyz€'))

Sales is your field.

jagan
Not applicable

Re: Formula for summing a value of a dimension

Hi Allen,

Use Pivot table extension and use

Dimension: Sales, Name

Expression: Sum(Type)

And use Subtotals.

Regards,

Jagan.