Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Dhruv28
Contributor
Contributor

How Can i get latest week's data from a month

Hi,

I am having an issue. I have a dataset which is updated weekly (On every Monday) and the field "WeeklyDateStamp" shows Every Monday's field. Earlier (before Jan 2023), this dataset has one or multiple week stamps. My need here is :-

I want to Pull latest week's data in the app. For E.g. If you see the table below, in the month of March-2023, there are 4 WeeklyDateStamps because data set has all the week's of data But I want only Latest week which is 03/27/2023.

As i mentioned in some months in 2022, there was only one time stamp. So if i can bring Latest values for each month this would solve the purpose, But I am not sure how to do this.

 

Can you guys please help...

WeeklyDateStamp Month Week's Data Required
03/27/2023 Mar Yes
03/20/2023 Mar -
03/13/2023 Mar -
03/06/2023 Mar -
02/27/2023 Feb Yes
02/20/2023 Feb -
02/13/2023 Feb -
02/06/2023 Feb -
01/30/2023 Jan Yes
01/23/2023 Jan -
01/16/2023 Jan -
01/09/2023 Jan -
01/02/2023 Jan -
12/05/2022 Dec Yes
10/31/2022 Oct -
10/03/2022 Oct -
09/05/2022 Sep Yes
08/01/2022 Aug Yes
07/04/2022 Jul Yes
05/30/2022 May Yes
05/09/2022 May -
04/04/2022 Apr Yes
Labels (4)
1 Reply
BrunPierre
Partner - Master
Partner - Master

@Dhruv28 The solution could be as follows.

Data:
LOAD WeeklyDateStamp,
Month,
[Week's Data Required]
FROM <SourceTable>;

Left Join
load Month,
Max(WeeklyDateStamp) as WeeklyDateStamp,
'Yes' as [Week's Data Required]

Resident Data
Group by Month;