Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ArjunPrasad
Contributor III
Contributor III

Last friday to till date data column

Hi All,

Need to have date column/field which can show last friday to till date data every time .( column need to have in script)

so that we can have filter of that.

the Date column dont include (Sat,Sun) i did that.

Exp: 14/5/2021 ,17/5/2021, 18/5/2021, 19/5/2021, 20/5/2021.

Can any one plz help on this .

Thanks,

Arjun

2 Replies
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @ArjunPrasad, I am not sure if I understood your question. But if you want to know how many days has run since last friday, you can try this:

SET FirstWeekDay=0;

Table:
Load
	[Date],
    WeekDay(Date)		AS WeekDay,
    Num(WeekDay(Date))	AS NumWeekDay,
    If(WeekDay([Date]) < 4, 3 + WeekDay([Date]), WeekDay([Date]) - 4)	AS DaysTillFriday
Inline [
Date
14/5/2021
15/5/2021
16/5/2021
17/5/2021
18/5/2021
19/5/2021
20/5/2021
];

JG

ArjunPrasad
Contributor III
Contributor III
Author

Hi @JuanGerardo  thanks for reply.

let me explain the requirement

i have a Date column and some other Dim, measure.

i wanted show the data/records  for During Last Friday to till date ( Excluding saturday and Sundays) i.e

From - 14/5/2021  to - 20/5/2021(Till/Current Date) (Note: Exclude Sat, sun)

lets say if the Current date is 26/5/2021 than it should show from 21/5/2021 to 26/5/2021.

For this i need a date column in script so that i can use as filter front end and select one value from that than it should show during this period From - 14/5/2021  to - 20/5/2021(Till/Current Date) (Note: Exclude Sat, sun).

Thanks,

Arjun