Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

jblomqvist
Contributor II

How to evaluate a variable in NPrinting?

Hi there,

I have a variable like this:

Variable name: vYear

Expression: Year(AddYears(Max(Date),-1))

When I put this Variable in NPrinting I do <vYear> it gives me the expression above, what I want is the result of the expression.

How do I do this?

7 Replies

Re: How to evaluate a variable in NPrinting?

May be call it as [vYear]

lech_miszkiewic
Honored Contributor III

Re: How to evaluate a variable in NPrinting?

you need to evaluate your expression  - which means you need to have "="ign in front of your expression:

like:


Expression: =Year(AddYears(Max(Date),-1))

cheers

Lech

---------------------------------------------

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 as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

kdmarkee221
New Contributor

Re: How to evaluate a variable in NPrinting?

Can you clarify this post?  Is the logic done in the script portion and if so, what does that look like?  I'm currently picturing or assuming the variable in the script is like this:

SET vYear = Year(AddYears(Max(Date),-1));

Thanks.

kdmarkee
Contributor III

Re: How to evaluate a variable in NPrinting?

I think I figured out what was meant by the "=". I did this in the Variable editor and not the script, but maybe you can do it in both places...I'm not sure.

lech_miszkiewic
Honored Contributor III

Re: How to evaluate a variable in NPrinting?

you can do it in both places. In script however i think you will have to use LET statement and apostrophies

like:

LET vYear = '=Year(AddYears(Max(Date),-1))';

kdmarkee
Contributor III

Re: How to evaluate a variable in NPrinting?

That's what I was looking for; I'll have to try that.  Thanks.

lech_miszkiewic
Honored Contributor III

Re: How to evaluate a variable in NPrinting?

see how it goes.. cheers Lech

Community Browser