Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

calculating variations by week

hello,

I have to calculate the result difference from a week day to another, but I didn't found any solution.

Here is the objective (see "variation" column):

DateProductSales ($)Variation ($)
29/5/2017Apples25k-
29/5/2017Bananas10k-
29/5/2017Lemons6k-
5/6/2017Apples21k+4k
5/6/2017Bananas23k+13k
5/6/2017Oranges19k-
12/6/2017Apples39k+18k
12/6/2017Bananas22k-1k
12/6/2017Oranges12k-7k

Do you have any idea?

Many thanks in advance,

Nicolas

1 Solution

Accepted Solutions
MVP
MVP

Re: calculating variations by week

Date and Product will be your dimensions here? Try this

Aggr(Sum(Sales) - Above(Sum(Sales), Product, (Date, (Numeric)))

5 Replies
MVP
MVP

Re: calculating variations by week

Is this something you need in the script or front end?

Not applicable

Re: calculating variations by week

preferably in the front end because the script has an automated load through several excel files.

MVP
MVP

Re: calculating variations by week

Date and Product will be your dimensions here? Try this

Aggr(Sum(Sales) - Above(Sum(Sales), Product, (Date, (Numeric)))

Not applicable

Re: calculating variations by week

It works Sunny

Thank you so much!

Not applicable

Re: calculating variations by week

By the way, it has worked without the "numeric" field:

Aggr(Sum(Sales) - Above(Sum(Sales), Product, (Date))