Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
robert2012
Contributor III
Contributor III

Calculation of growth

Hi all,

I have the following table:

GroupTimestampAnzahl_Tagessumme?? growth

A

12:00

55
A13:0010

5

A14:00155
A15:002510
B
B

I only have the first two columns => I don't have the third one (?? growth).

Now I want to show not the sum in a diagramm - but the growth.

How can this be calculated in the backend?

But it doesn't work. Can u help?

Thank you!

1 Solution

Accepted Solutions
sunny_talwar

Try this script:

Table:

LOAD * INLINE [

    Group, Timestamp, Anzahl_Tagessumme

    A, 12:00, 5

    A, 13:00, 10

    A, 14:00, 15

    A, 15:00, 25

];

FinalTable:

LOAD *,

  If(Group = Previous(Group), RangeSum(Anzahl_Tagessumme, -Previous(Anzahl_Tagessumme)), Anzahl_Tagessumme) as Growth

Resident Table

Order By Group, Timestamp;

DROP Table Table;

View solution in original post

3 Replies
lakshmikandh
Specialist II
Specialist II

Try using Peek/Previous functions, Peek() vs Previous() – When to Use Each

and for Grouping use Aggr() function

sunny_talwar

Try this script:

Table:

LOAD * INLINE [

    Group, Timestamp, Anzahl_Tagessumme

    A, 12:00, 5

    A, 13:00, 10

    A, 14:00, 15

    A, 15:00, 25

];

FinalTable:

LOAD *,

  If(Group = Previous(Group), RangeSum(Anzahl_Tagessumme, -Previous(Anzahl_Tagessumme)), Anzahl_Tagessumme) as Growth

Resident Table

Order By Group, Timestamp;

DROP Table Table;

View solution in original post

florentina_doga
Partner
Partner

try this script

aa:

load *,

if(Group=Previous(Group),Anzahl_Tagessumme-Previous(peek('growth')),Anzahl_Tagessumme) as growth;

load * inline [Group,    Timestamp,    Anzahl_Tagessumme

A, 12:00, 5

A, 13:00, 10

A,    14:00,    15

A,    15:00,    25

B           

B];