Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Week Day in Expression

Hello all ,

Kindly help me on the below scenario ,

If its Monday , I have to display the sum of previous three days sold amount(Friday,Saturday and Sunday) , otherwise it should show only the Previous day Sold amount. I tired the below expression . But I couldn't succeed. 

if(WeekDay([Sales Date])=0,

(Sum(if([Sales Date]=Today()-3 or [Sales Date]=Today()-2 or [Sales Date]=Today()-1,[Sold Amount]))),

(Sum(if([Sales Date]=Today()-1,[Sold Amount]))))

Format in the Script: SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

Thank you in Advance.


Best Regards,

Siva

2 Replies
sunny_talwar

Do you mean Max([Sales Date]) = Monday? or Today is Monday? Are you doing any selections on the date field? Would you be able to share a sample with expected output?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Change the first part into:

if(WeekDay(Today())=0, ...


Your expression will not do what you expect, as a simple reference to [Sales Date] outside of any aggregation function may return a lot of Sales Dates.

Peter