Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

Not applicable

how can I have a total from a single value of one dimension

I need to calculate some rate against a total  from a single value of one dimension,

but I don't find an appropriate expression;

for exemple:

in a pivot table there are any rows for dimensions:

year     tipology         sum        %

2013     sales           10000

2013     rmcost          7000      rmcost/sales

2013     pcost            2000      pcost/sales

2013     margin          1000      margin/sales

how can i calculate the percentage in expression table?

i need sum of tipology = 'sales'

thanks

Leonello

2 Replies
Employee
Employee

Re: how can I have a total from a single value of one dimension

Hi Leonello

You can play with the expression a little bit

try the following:

sum({$<tipology>}sales) / sum(TOTAL sales)

Is this what you need?

MVP
MVP

Re: how can I have a total from a single value of one dimension

with these data (if I understand)

test:

load * inline [

year  ,   tipology  ,       val  ,      %

2013  ,   rmcost    ,      7000  ,    rmcost/sales

2013  ,   pcost     ,       2000 ,     pcost/sales

2013  ,   margin    ,      1000  ,    margin/sales

];

1.png

Community Browser