Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

paulyeo11
Valued Contributor II

Now my label only display Jan - Dec , How to make it display Jan - Dec 2016 ?

Hi ALL


Below expression from Manishi , it does not display year 2016 after Jan - Dec

='Jan - '&SubField('$(MonthNames)', ';',  $(=IF(GetSelectedCount(month), Max({<year = {'$(=Max(year))'}>}month), Num(Month(Today())))))& ' ' & ''  &ColumnDim51& ' ' 

Can you help to add year number ?

Paul

1 Solution

Accepted Solutions
bonkornwit
Contributor

Re: Now my label only display Jan - Dec , How to make it display Jan - Dec 2016 ?

Hi.


Please try the following for your label.

='Jan - '&SubField('$(MonthNames)', ';',  $(=IF(GetSelectedCount(month), Max({<year = {'$(=Max(year))'}>}month), Num(Month(Today())))))& ' ' & ' ' & max(year) & ' '  &ColumnDim51& ' '

7 Replies
paulyeo11
Valued Contributor II

Re: Now my label only display Jan - Dec , How to make it display Jan - Dec 2016 ?

my qvw

Re: Now my label only display Jan - Dec , How to make it display Jan - Dec 2016 ?

Are you looking for something like attached?

bonkornwit
Contributor

Re: Now my label only display Jan - Dec , How to make it display Jan - Dec 2016 ?

Hi.


Please try the following for your label.

='Jan - '&SubField('$(MonthNames)', ';',  $(=IF(GetSelectedCount(month), Max({<year = {'$(=Max(year))'}>}month), Num(Month(Today())))))& ' ' & ' ' & max(year) & ' '  &ColumnDim51& ' '

paulyeo11
Valued Contributor II

Re: Now my label only display Jan - Dec , How to make it display Jan - Dec 2016 ?

Hi sunny

Thank you very much for your expression for 2016 is working fine , I try to modify your expression to make it display 2015 :-

='Jan - '&SubField('$(MonthNames)', ';',  $(=IF(GetSelectedCount(month), Max({<year = {'$(=Max(year)-1)'}>}month), Num(Month(Today())))))& ' ' & ' ' & max(year) & ' '  &ColumnDim51& ' '

it does not work. ( Meaning if user select year = 2016 , i need above expression display 2015.

Paul

paulyeo11
Valued Contributor II

Re: Now my label only display Jan - Dec , How to make it display Jan - Dec 2016 ?

Hi sunny

One more question , i notice the file is upload to this post the file size is only 1.7 Mb.

But when you open and save the file become double size.

What it the reasons ?

Paul

paulyeo11
Valued Contributor II

Re: Now my label only display Jan - Dec , How to make it display Jan - Dec 2016 ?

Hi Bon

I though you are sunny , any way both of you give the correct answer , thank you.

='Jan - '&SubField('$(MonthNames)', ';',  $(=IF(GetSelectedCount(month), Max({<year = {'$(=Max(year))'}>}month), Num(Month(Today())))))& ' ' & Max(year) & ' '  &ColumnDim51 

Paul

paulyeo11
Valued Contributor II

Re: Now my label only display Jan - Dec , How to make it display Jan - Dec 2016 ?

Hi Sunny

After i look closely of Bon expression , where he high light the additional code he add to make year number display out , so i try to add year-1 from year and it work fine now.

Thank you

Paul

Community Browser