# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Rules, plus terms and conditions, can be found here.
Valued Contributor II

## Create var vYn1 and replace 8 with \$(vYn1) not working ?

Hi All

I have Below expression , working fine :-

money(

sum({\$<year = {\$(=max(year)-8)}, month = {"<=\$(=max({<year={\$(=max(year))}>} month))"}>}\$(ColumnDim51)/\$(Columndim89)/1000)

, \$(vMoneyFormatK))

Because , i need to reduce number of tab , i replace the 8 with variable. So i create vYn1 and set this var = 2009. and i replace the 8 with \$(vYn1) :-

money(

sum({\$<year = {\$(=max(year)-\$(vYn1))}, month = {"<=\$(=max({<year={\$(=max(year))}>} month))"}>}\$(ColumnDim51)/\$(Columndim89)/1000)

, \$(vMoneyFormatK))

But it display null value. Can some one share with me why ?

Paul

1 Solution

Accepted Solutions
Honored Contributor II

## Re: Create var vYn1 and replace 8 with \$(vYn1) not working ?

Hi,

This is because \$(vYn1) has value 2019 and =Max(year)-\$(vYn1) is calculating a number 8. and in your expression setanalysis is given as year = {\$(=max(year)-\$(vYn1))}, so it is year is getting value 8 thus you are getting null vaule.

assign vYn1 = 8 then it should work.

HTH

sushil

3 Replies
Valued Contributor II

## Re: Create var vYn1 and replace 8 with \$(vYn1) not working ?

my QVW !

Honored Contributor II

## Re: Create var vYn1 and replace 8 with \$(vYn1) not working ?

Hi,

This is because \$(vYn1) has value 2019 and =Max(year)-\$(vYn1) is calculating a number 8. and in your expression setanalysis is given as year = {\$(=max(year)-\$(vYn1))}, so it is year is getting value 8 thus you are getting null vaule.

assign vYn1 = 8 then it should work.

HTH

sushil

Valued Contributor II

## Re: Create var vYn1 and replace 8 with \$(vYn1) not working ?

Hi Sushil

Thank you very much for help me spot my mistake.

It there a way i can replace the Slide bar ? So that i dont need to create many button.

Paul