Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
paulyeo11
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
sushil353
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
paulyeo11
Valued Contributor II

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

my QVW !

sushil353
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

paulyeo11
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

Community Browser