Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
martinr_
Creator
Creator

RangSum per Year

I have the following dimensions year-calendar week.

Now i want to have a cumulative sum per year.

But should always start at the beginning of the year.

This formula does not start at zero at the beginning of the year in an line diagram. in an tabel it is fine.

I do not find a solution.


RangeSum(Above(Sum({<TYP={'SALES'}>}PRICE),0,RowNo()))

17 Replies
martinr_
Creator
Creator
Author

Here is the Testfile !

sunny_talwar

Create Week(DATUM) as Week in the script and then try this

Aggr(RangeSum(Above(Sum({<BELEGTYP={'AB'}>}GESPREISNETTO),0,RowNo())), GESCHAEFTSJAHR, (Week, (NUMERIC)))

martinr_
Creator
Creator
Author

Sorry, i am new with this.

Do you mean with script when loading data, or a new dimension?

sunny_talwar

While loading your data

LIB CONNECT TO 'MCQLIK (mc_qservice)';

LOAD *,

          Week(DATUM) as Week;

SQL SELECT * FROM VERKAUF order by geschaeftsjahr,datum;

SET DateFormat='YYYY.MM.DD';

SET TimestampFormat='YYYY.MM.DD hh:mm:ss[.fff]';

martinr_
Creator
Creator
Author

We are approaching.
The arrangement does not fit so completely yet.

The sum of KW13 is displayed at KW01.

sunny_talwar

To me it looks like the 8035624 is associated with 2016-KW52.... May be create a table object with the same dimension and measure and see which YearWeek correspond to which value...

martinr_
Creator
Creator
Author

our Businessyear ist not from 01 - 52. That i think is the problem.

when i script it so, all is fine.

Aggr(RangeSum(Above(Sum({<BELEGTYP={'AB'}>}GESPREISNETTO),0,RowNo())), GESCHAEFTSJAHR, (Week, (NUMERIC)))

sunny_talwar

So everything working good now? Please close the thread by marking correct and helpful responses.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny