Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
nguyenviethung
Contributor III
Contributor III

How to calculate Sales of previous weeks

Hi everyone,

I got data like this:

  

DateProductSales
4/28/2018A1
4/29/2018A2
4/30/2018A3
5/1/2018A4
5/2/2018A5
5/3/2018A6
5/4/2018A7
5/5/2018A8
5/6/2018A9
5/7/2018A10
5/8/2018A11
5/9/2018A12
5/10/2018A13
5/11/2018A14
5/12/2018A15
5/13/2018A16
5/14/2018A17
5/15/2018A18
5/16/2018A19
5/17/2018A20
5/18/2018A21

Date will be loaded with AutoCalendar function in Qlik Sense and bear Date.autoCalendar.Week.

Now what i want is a table of calulation like this:

       

   

WeekSales (expression -> result)Previous-Week-Sales
W17=Sum(Sales) -> 1??? ->  -
W18=Sum(Sales) -> 35??? -> 1
W19=Sum(Sales) -> 84??? -> 35
W20=Sum(Sales) -> 111??? -> 84

Can anyone help me the expression to calculate the previous-week-sales for each week like this? Thank you all of you.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

SUM(Sales)

&

Above(SUM(Sales))

View solution in original post

2 Replies
MK_QSL
MVP
MVP

SUM(Sales)

&

Above(SUM(Sales))

nguyenviethung
Contributor III
Contributor III
Author

Thank you. Love you..