Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have, in the course of fixing a larger issue, come across one relatively small, but annoying thing:
- I have a master_calendar in a qvs file that is loaded into every app.
- This master_calendar is currently for one year only
- In the calendar, there is a binary field returning 1 for working_days (Mo-Fri) and 0 for weekends. Public holidays are not accounted
for.
- Based on this, I have two variables: Days_YTD (all days) and Workdays_YTD (Mo-Fri only).
=> The code for these is as follows:
COUNT({1<%Datum = {"$(= '>=' & makedate(year(today()), 1, 1))"}, %Datum = {"$(= '<' & DATE(v_today_num))" }>} Werktag)
[for all days YTD]
SUM({1<%Datum = {"$(= '>=' & makedate(year(today()), 1, 1))"}, %Datum = {"$(= '<' & DATE(v_today_num))" }>} Werktag)
[for the workdays]
Strangely, when I edit the qvs file to make the calendar run for three years (by editing the start_date, incl. testing the code in a textbox)
=> The variables suddenly change and display about three times the nr. of days?!
There must be some error in my set_expressions - but which? I can't spot it.
Can anybody help me, please?
Thanks a lot!
Best regards,
DataNibbler
You shouldn't use the same field twice within the same set modifier. Combine your two date ranges into one search expression:
=COUNT({1<%Datum = {">=$(=makedate(year(today()), 1, 1))<$(=DATE(v_today_num))" }>} Werktag)
You shouldn't use the same field twice within the same set modifier. Combine your two date ranges into one search expression:
=COUNT({1<%Datum = {">=$(=makedate(year(today()), 1, 1))<$(=DATE(v_today_num))" }>} Werktag)
Cool! Didn't know that yet.
Thanks a lot!
Best regards,
DataNibbler