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

How to calculate previous week value ?

Hi All,

How to calculate previous week value?

in data source I have [Week Ending] field where field is in  numeric date format and having last day of every week value

I also created one field prevWeekEnding in my data model

I am using following formula

=sum( {$<[Week Ending]= ,prevWeekEnding={"$(=Date([Week Ending]-7))"}>} ListUSD])

while I am using this formula ,

without any selection I am getting  result 0 and if I select any  date from [week Ending ] , I got the result of current date selection value.

1 Solution

Accepted Solutions
shraddha_g
Partner - Master III
Partner - Master III


Try

prevWeekEnding={"$(=Date(max([Week Ending])-7))"}>}

View solution in original post

3 Replies
Chanty4u
MVP
MVP

Anil_Babu_Samineni

I am not following as guessing you must have Week field, then try this?

=sum( {$<[Week Ending]= ,prevWeekEnding={"$(=Date([Week Ending]-7))"}, Week = {'$(Max(Week) - 1)'}>} ListUSD])


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
shraddha_g
Partner - Master III
Partner - Master III


Try

prevWeekEnding={"$(=Date(max([Week Ending])-7))"}>}