Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sum up every 15 values of a column

Hi,

I have a column which contains numerical values. I want to sum up every 15 values.

So lets say i have 60 values in my column and I want to have 4 sums as a result:

sum1 = sum(value1,..., value15)

sum2 = sum(value16, ..., value30)

sum3 = sum(value31, ..., value45)

sum4 = sum(value46, ..., value60)

How do I achieve that?

Greetings

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

Dim: =SubField(Class(Time,14),' <= x < ',2)

Expr: Avg(Power)

View solution in original post

9 Replies
anbu1984
Master III
Master III

All 60 values present in single column? What is the rule to select 15 values?

Not applicable
Author

Yes all 60 values are present in a single column.

Can you explain what you mean by "rule to select 15 values"?

I need the sums of every 15 values for my calculations.

anbu1984
Master III
Master III

How do you pick 15 values(value1,..value15) in sum1?

Can you explain "Every 15 values" with an example?

Not applicable
Author

My Data looks like this:

Time [minutes]Power [kW]
1532
23525
3321
454
587
6874
76
8387
......

I need to calculate the average value of Energy for every 15 minutes.


So if I have data from 480 minutes, I need to calculate 32 average values:

Average value of Energy for minute 1 - 14, 15-29, 16-44, ...

Not applicable
Author

In QV Chart, we can accumulate values by 15 steps back, but this won't satisfy your requirement as you need sum2 as sum(16-30 columns).

My Thought is give a recno before loading rows of that table and create a new dimension based floor(recno()/15). So that we can sum in QV.

anbu1984
Master III
Master III

Dim: =SubField(Class(Time,14),' <= x < ',2)

Expr: Avg(Power)

terezagr
Partner - Creator III
Partner - Creator III

Could an intervalMatch do this for you? IntervalMatch

maxgro
MVP
MVP

dimension          div(Time, 15)               or   dual(div(Time,15)*15 & '..' & (div(Time,15)*15+14) , div(Time,15))

expression         avg(Power)

Not applicable
Author

Hi,

thank you for your answer. That was the solution.