Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Cecilia
Contributor II
Contributor II

Nprinting Filters - three days ago

Hi! 

I am trying to create a filter in Nprinting to create a report set to three days ago. 

I have tried this:

Skjermbilde.JPG

This is to generate a report to be distributed on mondays with data from friday. 

When I do this, I only get this: 

"Some reports failed to generate:

  • Report "Dagsrapport" with output format XLSX


Please contact your administrator for further details"


Thankful for any help!

/Cecilia

Labels (1)
1 Solution

Accepted Solutions
Ruggero_Piccoli
Support
Support

Hi,

It is hard to understand without seeing the data. Today() returns the date with 00:00:00 as time so check that date of 3 days ago also have time set to 00:00:00. A date is a number with the hours that are in the decimal part. num(Today()) for example, returns 43571 if you are comparing with a date field with hours it could be that you are comparing with 43571,5 so they are not equal.

You could also try to add a function that rounded the date.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.

View solution in original post

11 Replies
Ruggero_Piccoli
Support
Support

Hi,

Dates are dual fields. Be sure that the type calculated by the formula matches the one in the source app.

You could test the formula you are using in the filter also in the source app.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Cecilia
Contributor II
Contributor II
Author

Hello! 

Thank you for your reply. 

It works when I use "=num(today()-1)" (for yesterday) 

Any ideas? 🙂 

/Cecilia

Ruggero_Piccoli
Support
Support

I think you have no data for Today()-3 in the connected app.



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Smiley LOL

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Cecilia
Contributor II
Contributor II
Author

Good morning from Norway!

This is not the case, I have data in my source for today()-3.

And since it works when I'm using num(today()-1) why wouldn't it work with num(today()-3) ?

The background for this problem is that we want to send out a report for data from friday on mondays. 
Is there any other way to do this? 

Thank you in advance for helping 🙂 

/Cecilia

Ruggero_Piccoli
Support
Support

Hi,

It is hard to understand without seeing the data. Today() returns the date with 00:00:00 as time so check that date of 3 days ago also have time set to 00:00:00. A date is a number with the hours that are in the decimal part. num(Today()) for example, returns 43571 if you are comparing with a date field with hours it could be that you are comparing with 43571,5 so they are not equal.

You could also try to add a function that rounded the date.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
bramkn
Partner - Specialist
Partner - Specialist

Or the easiest way is to just create a flag within your calendar to select the day you want to be selected. In Nprinting you can just put the filter on =1
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

agree with all comments above - hard to tell you anything without looking at your datamodel and script in Qlik.  Proper nPrinting development starts with proper Qlik development. We can't tell more than we know, so without knowing your app it is hard to tell.

i suggest you read this:

https://nprintingadventures.wordpress.com/2019/02/15/the-pitfalls-of-nprinting-filters-part-1-dates-...

 

I also agree on using flag and setting everything up in Qlik script.

 

cheers

Lech

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Cecilia
Contributor II
Contributor II
Author

Hello again everyone

Thank you so much for your helpful comments

I think we overestimated Nprintings functions, we see now that we have to go back to our source and do as you have suggested to make this work. 

/Cecilia