Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need to have two expressions one is for current day sale and other is for previous day sales for that particular company,here current day is latest date for respective company.
The problem here is when company is having sales on Monday then current day is Monday and previous day is Friday. Need to excludes weekend dates from the previous day expression.
For Current day i have used below expression it is working as expected.
sum({<Business date={"$(=(max(Business date)))"}>} [St amt])
But for previous day expression i am not getting, please help me out this issue.
i have attached excel file for sample data.
Thanks in advance.
Regards,
Venkey
WeekDay() ,WorkDate()will help you in this situation.
Simply use FirstWorkDate() for this
=If(WeekDay(Today()) = 'Sun' OR WeekDay(Today()) = 'Sat', firstworkdate (Today(), 1), firstworkdate (Today(), 2) )
From Qlikview Help file:
firstworkdate(end_date, no_of_workdays {, holiday} )
Returns the latest starting date to achieve number_of_workdays (Monday-Friday) ending no later than end_date taking into account any optionally listed holidays. End_date and holiday should be valid dates or timestamps.
Examples:
firstworkdate ('2007-03-01', 9) returns '2007-02-19'
firstworkdate ('2006-12-31', 8, '2006-12-25', '2006-12-26') returns '2006-12-18'
else
If(WeekDay(Today()) = 'Sun', Date(Today() - 2), Date(Today() - 1)))
Hello,
Try with Networkingdays() function.
Follow below link:
HI Thanks for quick reply.
I want do it in set expression.
regards,
venkey