Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

gouthamkk
Contributor

Sum of specific rows in a Straight Table chart

Hi,

I am trying find a way to get Sum of specific rows in a Starlight table Chart.

here is my expression in the straight table

i cannot  use simple sum or aggr because the chart has Pick function which produces different result set for each dimension in a row.

I have 7 rows. I am trying to get the totals in the last row. Some thing like sum(row(1)+row(2)+row(5)+row(7)) from column 1

and same thing for column 2

Can some one please advise.?

Here is an example set

      

Cost ElementValuePercentPercent 2Percent 3 Percent 4
ROW 1374709.460.51540.51549.09938.2969
ROW 2936834.911.28871.288622.749620.7437
ROW 3521131.920.71680.716812.654911.5390
ROW 400.00000.00000.00000.0000
ROW 51457966.830.00000.00000.00000.0000
ROW 6416083.050.57230.572310.10399.2130
ROW 7270109.780.37150.37156.55925.9808
ROW 800.00000.00000.00000.0000
Total2518869.123.4648166853.464700461.1669289755.77349614
1 Solution

Accepted Solutions
gouthamkk
Contributor

Re: Sum of specific rows in a Straight Table chart

Hi

I found the solution as below

Above((Column(1)), 8)+ Above((Column(1)), 7)+Above((Column(1)), 6) + Above((Column(1)), 3)+ Above((Column(1)), 2) + Above((Column(1)), 1)

In the expression i am excluding row 4 and 5.

Thanks for everyone inputs and time

8 Replies
vishsaggi
Esteemed Contributor III

Re: Sum of specific rows in a Straight Table chart

Can you share some sample data with expected output to work on?

gouthamkk
Contributor

Re: Sum of specific rows in a Straight Table chart

HI I have added example set so the Total is sum of each column excluding Row 5

vishsaggi
Esteemed Contributor III

Re: Sum of specific rows in a Straight Table chart

What are the values in your CostElement field are they same as mentioned above in your example set ?

gouthamkk
Contributor

Re: Sum of specific rows in a Straight Table chart

Yes

Re: Sum of specific rows in a Straight Table chart

Why not with set analysis in front end. Can you try this

Sum({<[Cost Element] -= {'ROW 5'}>} value)

Not applicable

Re: Sum of specific rows in a Straight Table chart

Hi,

Is the attached any good/useful? Here is the screenshot just in case

qvw screenshot.GIF

gouthamkk
Contributor

Re: Sum of specific rows in a Straight Table chart

hi,

Like i mentioned my dimension is loaded from a inline table. it is not associated with any tables.

EG:

Pick(Match(_Dimension,'Row1','Row2','Row3','Row4','Row5',

  'Row6','Row7','Row8') ,

expresion1,

expresion2,

expresion3,

expresion4,

expresion5,

expresion6,

expresion1+expresion2+expresion3+expresion5 ---i want some thing like this for Row 7

)

gouthamkk
Contributor

Re: Sum of specific rows in a Straight Table chart

Hi

I found the solution as below

Above((Column(1)), 8)+ Above((Column(1)), 7)+Above((Column(1)), 6) + Above((Column(1)), 3)+ Above((Column(1)), 2) + Above((Column(1)), 1)

In the expression i am excluding row 4 and 5.

Thanks for everyone inputs and time

Community Browser