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: 
Anonymous
Not applicable

Previous week Date

Hi team,

Thanks in advance for your attention .

Here my problem statement is that I want to have previous week Thursday date if in my table if today is not Thursday.

Means my dimension should have date of Thursday only ,if today is Monday than it should show previous Thursday's date.

Thanks,

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Try

=if(Weekday(Today())=3,Today(),date(Today()-(num(WeekDay(today()))+4)))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

7 Replies
vinieme12
Champion III
Champion III

Try

=if(Weekday(Today())=3,Today(),date(Today()-(num(WeekDay(today()))+4)))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
eromiyasimon
Creator II
Creator II

=date(date#(Today(),'MM/DD/YYYY')-7,'DD/MM/YYYY')

use this

Not applicable
Author

Hi,

Sorry

I am not clear with your question could you please elaborate ?

Also weekday() Function will return only string values not numeric values.

So weekday(Today()) will only return today's day name and not 3 or 4.

Thanks.

vinieme12
Champion III
Champion III

Weekday() is a dual function, you can read more about it in help

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MarcoWedel

Hi,

one solution might be:

Date(Floor(YourDate,7,5))

QlikCommunity_Thread_245862_Pic1.JPG

tabDates:

LOAD *,

     Date(Floor(YourDate,7,5)) as PreviousThursday;

LOAD Date(YearStart(Today())+RecNo()-1) as YourDate

AutoGenerate 50;

hope this helps

regards

Marco

Anonymous
Not applicable
Author

Hi Marco,

Thanks for your reply, but I have not to use any base dimension, means I have to add one dimension which should so Thursday's date without dependency on any dimension.

Thanks,

Pooja 

MarcoWedel

Hi,

that's just been an example to demonstrate this expression's results.

Instead of

Date(Floor(YourDate,7,5))

you could also use


Date(Floor(Today(),7,5))


hope this helps


regards


Marco