Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Agis-Kalogiannis
Employee
Employee

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?

maxgro
MVP
MVP

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