Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
RafaelPerez
Contributor II
Contributor II

Adding up values between specific dates.

My main table is composed mainly of and ItemID, a Store ID, a InitialStock from Monday of that week, Sales since Monday of that week, OtherMovements and Date.

The only data that is from the date of the row is Movements, and that's what I want to add up.

I'm trying to add all the movements from Monday of that week to the selected date. For example: If I select Thursday, it should add up all the info from Monday, Tuesday, Wednesday, and Thursday, and add it up to the InitialStock and Sales to get the Stock.
I cannot provide the data set because of working policies.

Every bit of help would be appreciated.

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

Do you mean monday of that week?
Use setanalysis and weekstart function.
something like below (using Max(OrderDate) because if no date is selected it will show latest week)

Sum( {<OrderDate={"<=$(=Max(OrderDate)) >=$(=WeekStart(Max(OrderDate)))"}>} LineSalesAmount)

View solution in original post

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

Do you mean monday of that week?
Use setanalysis and weekstart function.
something like below (using Max(OrderDate) because if no date is selected it will show latest week)

Sum( {<OrderDate={"<=$(=Max(OrderDate)) >=$(=WeekStart(Max(OrderDate)))"}>} LineSalesAmount)
RafaelPerez
Contributor II
Contributor II
Author

It worked pretty well, and used it as the base for other expressions, Thanks!
dplr-rn
Partner - Master III
Partner - Master III

happy to help