Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Accumulate in dimensions

Hello experts!

I need you valuable help.

I have the above pivot in qlikview

MonthSales CYSales PYm2Visitors
13.774.659,1730.855.173,028.236,22677.175
Jan2.695.856,622.401.932,998.401,45127.612
feb1.740.020,232.012.334,008.354,1990.147
Mar1.762.776,731.636.124,548.231,6992.068
Apr2.890.977,003.245.520,458.021,08137.497
May2.532.552,552.456.297,858.091,10122.356
Jun2.152.476,042.359.258,678.351,44107.495
Jul0,002.569.794,96-0
Aug0,001.798.450,75-0
Sep0,002.118.124,61-0
Oct0,002.918.765,67-0
Nov0,003.463.481,42-0
Dec0,003.875.087,11-0

I want to add rows in dimensions field,

I have  to show the data in a table as cumulative sum of Month

I want the data to be displayed like this:


MonthSales CYSales PYm2Visitors
13.774.659,1730.855.173,028.236,22677.175
Jan2.695.856,622.401.932,998.401,45127.612
feb1.740.020,232.012.334,008.354,1990.147
2mos4.435.876,85
Mar1.762.776,731.636.124,548.231,6992.068
3mos6.198.653,58
Apr2.890.977,003.245.520,458.021,08137.497
4mos9.089.630,58
May2.532.552,55

2.456.297,85

8.091,10122.356
5mos11.622.183,13
Jun2.152.476,042.359.258,678.351,44107.495
6mos13.774.659,17
Jul0,002.569.794,96-0
7mos13.774.659,17
Aug0,001.798.450,75-0
8mos13.774.659,17
Sep0,002.118.124,61-0
9mos13.774.659,17
Oct0,002.918.765,67-0
10mos13.774.659,17
Nov0,003.463.481,42-0
11mos13.774.659,17
Dec0,003.875.087,11-0
12mos13.774.659,17

I really appreciate any help you can provide!!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

have a look at the attachment:

View solution in original post

21 Replies
antoniotiman
Master III
Master III

Hi,

maybe like this :

Anonymous
Not applicable
Author

Thanks for answering but as you can see above i have posted the final layout.

It is important for me to be exported like this, so i don't have to spend time working in excel sheet.

jmvilaplanap
Specialist
Specialist

You can use the previous function to create a formula with the previous row that you are using at the moment

For example:

  • SalesCY + previous(AccSalesCY)  AS AccSalesCY


In the Load Statement

Anonymous
Not applicable
Author

do you need everything calculated daywise in frontend?

Anonymous
Not applicable
Author

can you please attach an example?

Anonymous
Not applicable
Author

yes

Anonymous
Not applicable
Author

here's a sample how it could basically work ...

LOAD Month(Datefield) as Month,Value;
LOAD * INLINE [
Datefield, Value
01.01.2017, 1
01.02.2017, 2
01.03.2017, 3       
01.04.2017, 4
01.05.2017, 5
01.06.2017, 6           
01.07.2017, 7
01.08.2017, 8
01.09.2017, 9       
01.10.2017, 10
01.11.2017, 11
01.12.2017, 12         
]
;

ISLAND:
load ' ' as DUMMY AutoGenerate 1;
load '  ' as DUMMY AutoGenerate 1;

antoniotiman
Master III
Master III

Table:
LOAD RowNo()*10 as Rowno,Month(Date#(Month,'MMM') ) as Month,
[Sales CY],
[Sales PY],
m2,
Visitors,
RangeSum([Sales CY],Peek(Mos)) as Mos
FROM
"https://community.qlik.com/message/1299178"
(html, codepage is 1252, embedded labels, table is @1)
Where Len(Trim(Month)) > 0;
Concatenate LOAD
Num(Month)*10+1 as Rowno,Num(Month)&'Mos' as Month,Mos as [Sales CY]
Resident Table where Month
>= 2;

Anonymous
Not applicable
Author

Thank you very much,

Below you can see the actual data i have in my script.

LOAD Building,

     Date,

     Year,

     Month,

     Day,

     Sales,

     Receipts,

     m2,

     Visitors,

     if(Year = '2017', 1, 0) as CY,

     if(Year = '2016', 1, 0) as PY

FROM

(qvd);

can you plz transform the above table you send me in this data,

I tried to do it by myself but it it ended up in script error:

Field names must be unique within table

Table:

LOAD RowNo()*10 as Rowno,Month(Date#(Month,'MMM') ) as Month,

Building,

     Date,

     Year,

     Month,

     Day,

     Sales,

     Receipts,

     m2,

     Visitors,

     if(Year = '2017', 1, 0) as CY,

     if(Year = '2016', 1, 0) as PY,

    

RangeSum(Sales,Peek(Mos)) as Mos

FROM

(qvd)

Where Len(Trim(Month)) > 0

and this dialog box:

Table not found error

Table 'Table' not found

Concatenate LOAD

Num(Month)*10+1 as Rowno,Num(Month)&'Mos' as Month,Mos as Sales

Resident Table where Month >= 2