Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

ali_hijazi
Honored Contributor

parameterized variables

Hello

I'm working on qlikview dashboard

I need to create a variable that takes parameters

I created it as follows:

vmaxDate as =max({1<YEAR=$::YEAR,MONTH_NUM={$1}>} trx_date)

I put a text box object and put in it the following:

$(vmaxDate(1))

but I get null whereas if I put in the definition 1 instead of $1 I get correct value

kindly advise

4 Replies
MVP
MVP

Re: parameterized variables

How about if you do like this

=Max({1<YEAR=$::YEAR, MONTH_NUM={'$1'}>} trx_date)

ali_hijazi
Honored Contributor

Re: parameterized variables

it worked if I put Month_Num={"$(=$1)"}

but if the variable definition begins with equal sign I always get null

kindly advise

does parameterized variables work only if the definition doesn't start with equal sign?

ali_hijazi
Honored Contributor

Re: parameterized variables

how do I call the variable $(vmax_date(1))

Re: parameterized variables

You should not use an equal sign at the beginning of this variable definition. A leading = means "calculate this immeadiately",  You want to defer calculation until the variable is called,

-Rob

Community Browser