Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm looking for assistance to either create a variable for QlikView or have a filter that will work on NPrinting for getting the current year to date minus the current month.
Currently I have a filter that does the current YTD and includes the current months data -> Let vCurrentFiscalYear = num(YearStart(Today())); // Current Year.
I have tried a few variations from the forums on both QlikView (by creating a new variable) and NPrinting.
Would anyone be able to assist please.
These are the current other variables in my script.
Thanks.
For the NPrinting filter, use the advanced search
=YOUR_DATE_FIELD_HERE >= YearStart(Floor(Today())) and YOUR_DATE_FIELD_HERE < MonthStart(Floor(Today()))
Hi @jwjackso
As much as your expression will work I'd like to argue on why would you use Floor in the places you have used it?
Floor() removes decimal points, so in case of dates it removes time part of date/timestamp. Now as soon as you introduce functions like MonthStart or MonthEnd or YearStart, YearEnd you will get back timestamp part, but here is a trick. YearStart and MonthStart will put it back to the same value as Floor() function does, but if you were to use MonthEnd or YearEnd functions you will get back date&23:59:59 timestamp. Thats it why if anything it only makes sense to put Floor ahead of your month/year start formulas despite the fact that in this case it is completel reduntant:
=YOUR_DATE_FIELD_HERE >= Floor(YearStart(Today())) and YOUR_DATE_FIELD_HERE < Floor(MonthStart(Today()))
instead of:
=YOUR_DATE_FIELD_HERE >= YearStart(Floor(Today())) and YOUR_DATE_FIELD_HERE < MonthStart(Floor(Today()))
in NPrinitng use Advanced Search option as per @jwjackso suggestion. You may want to look at this post with samples: https://nprintingadventures.com/2019/06/26/nprinting-filters-part-3-advanced-search/
For the NPrinting filter, use the advanced search
=YOUR_DATE_FIELD_HERE >= YearStart(Floor(Today())) and YOUR_DATE_FIELD_HERE < MonthStart(Floor(Today()))
Hi @jwjackso
As much as your expression will work I'd like to argue on why would you use Floor in the places you have used it?
Floor() removes decimal points, so in case of dates it removes time part of date/timestamp. Now as soon as you introduce functions like MonthStart or MonthEnd or YearStart, YearEnd you will get back timestamp part, but here is a trick. YearStart and MonthStart will put it back to the same value as Floor() function does, but if you were to use MonthEnd or YearEnd functions you will get back date&23:59:59 timestamp. Thats it why if anything it only makes sense to put Floor ahead of your month/year start formulas despite the fact that in this case it is completel reduntant:
=YOUR_DATE_FIELD_HERE >= Floor(YearStart(Today())) and YOUR_DATE_FIELD_HERE < Floor(MonthStart(Today()))
instead of:
=YOUR_DATE_FIELD_HERE >= YearStart(Floor(Today())) and YOUR_DATE_FIELD_HERE < MonthStart(Floor(Today()))
in NPrinitng use Advanced Search option as per @jwjackso suggestion. You may want to look at this post with samples: https://nprintingadventures.com/2019/06/26/nprinting-filters-part-3-advanced-search/
Thanks a million @jwjackso & @Lech_Miszkiewicz
Put me on the right path and got the resolution.
Assistance is much appreciated.