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: 
Anonymous
Not applicable

NPrinting - Fiscal Year filter with if condition

Hello,

I have a question related to NPrinting filters.

Within my application I have a filter for the current Fiscal Year.

The fiscal year is starting at the 01.10. and it ends at the 30.09.

The calculated Year value for the current fiscal year is 2016.

My question is, is there a possibility to calculate the fiscal year within NPrinting depending from the e.g. month number?

For example if (vCurMonth >= 10, FiscalYear(today(0)), FiscalYear(AddYears(today(0), - 1));

The variable vCurMonth is also calculated in the script.

Many thanks in advance and best regards,

Claus

1 Solution

Accepted Solutions
mkelemen
Creator III
Creator III

Hi Claus,

it is possible.

This works in version 16.

If you have filter for FiscalYear put the formula (needs to have = ) into Value and deselect IsNumeric and select Evaluate

=If(Month(Today())>=10, Year(Today()), Year(AddYears(Today(), -1)))

This way the formula will be evaluated and the result will be inserted into FiscalYear.

In nprinting 17 it is very similar.

BR,

  Matus

View solution in original post

11 Replies
mkelemen
Creator III
Creator III

Hi Claus,

it is possible.

This works in version 16.

If you have filter for FiscalYear put the formula (needs to have = ) into Value and deselect IsNumeric and select Evaluate

=If(Month(Today())>=10, Year(Today()), Year(AddYears(Today(), -1)))

This way the formula will be evaluated and the result will be inserted into FiscalYear.

In nprinting 17 it is very similar.

BR,

  Matus

Anonymous
Not applicable
Author

Hi Matus,

many thanks! Your solution works perfect!

I'm currently thinking about an update to NPrinting 17. Is there a release note which describes the differences?

Best regards,

Claus

mkelemen
Creator III
Creator III

Be aware that 17 is not a direct upgrade so not all functionality that is in 16 is already ported.

I think one that is still missing is variable filter - but I cannot find it in any release notes.

Also from what I saw you can not import from your nsq files from 16 so you will have to recreate all the filters, tasks, etc. Only the templates can be imported.

  Matus

Anonymous
Not applicable
Author

Ok, many thanks! Considering this points I will think about the upgrade to 17.

BR,

Claus

Daniel_Jenkins
Specialist III
Specialist III

Hi Matus,

Variable filters are still not possible in 17.2.2. Refer to the table at the bottom of this page: https://help.qlik.com/en-US/nprinting/17.2/Content/Introduction/Introduction.htm

Also, your suggested formula will not work in version 17.x. Formulae must return single values only - Month(Today())=10 is fine, Month(Today())>=10 is not.

https://help.qlik.com/en-US/nprinting/17.2/Content/FiltersCycles/StaticDynamicFilters/Static-dynamic...

HTH - Daniel.

mkelemen
Creator III
Creator III

Hi Daniel,

thanks for the link. Is there some roadmap for the missing functionality?

The >= is only in the if condition part. The formula returns single year. So it should be fine.

What I meant by similar is the IsNumeric and Evaluate flags setting. In 16 the IsNumeric needs to be deselected otherwise it does not work; in 17 there is no IsNumeric flag.

  Matus

Daniel_Jenkins
Specialist III
Specialist III

Hi Matus,

Of course you are right.

To clarify, in version 17.x you need to select Evaluate value from the value type dropdown. You can also use variables in your formula in answer to the original enquiry by Claus. Example:

HTH - Daniel.

Not applicable
Author

if i have a variables range for start and end date , how can i make it here in Nprinting 17.2

Posting_Date={'>=$(=Date(vFrmDate_Fmt))<=$(=Date(vToDate_Fmt))

Not applicable
Author

if i have a variables range for start and end date , how can i make it here in Nprinting 17.2

Posting_Date={'>=$(=Date(vFrmDate_Fmt))<=$(=Date(vToDate_Fmt))