Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

amit_saini
Honored Contributor III

Month-Year Script help!

Hi Folks,

Always want to show only last 12 months based on below expression in list box:

=Month ([GSE by KT plant.Month]) & '-' & Year ([GSE by KT plant.Month])

Please suggest ???

Thanks,

AS

1 Solution

Accepted Solutions
MVP
MVP

Re: Month-Year Script help!

Aggr(if([GSE by KT plant.Month]>='$(=Max([GSE by KT plant.Month],10))', [GSE by KT plant.Month]),[GSE by KT plant.Month])

17 Replies
balrajahlawat
Esteemed Contributor

Re: Month-Year Script help!

why you are doing this: =Month ([GSE by KT plant.Month]) & '-' & Year ([GSE by KT plant.Month])??

Instead of this use monthname(DateField) at script, you will get same result....

see this:

Show rolling 12 Months only for last 12 months.

senpradip007
Valued Contributor III

Re: Month-Year Script help!

Why do you not use MonthYear() function?

amit_saini
Honored Contributor III

Re: Month-Year Script help!

To get Month and Year from [GSE by KT plant.Month]

Actually we are not having any date field for this application

Thanks,
AS

Re: Month-Year Script help!

what is values in [GSE by KT plant.Month] field?

amit_saini
Honored Contributor III

Re: Month-Year Script help!

Thanks,
AS

Re: Month-Year Script help!

Use Makedate or monthname function if you have only Year or month field like

=MonthName(MakeDate(Year([GSE by KT plant.Month]),Month([GSE by KT plant.Month])))

And try

=Monthname( Addmonths(MonthName(MakeDate(Year([GSE by KT plant.Month]),Month([GSE by KT plant.Month]))),-12))

Regards

Anand

amit_saini
Honored Contributor III

Re: Month-Year Script help!

Hi Anand,

=Monthname( Addmonths(MonthName(MakeDate(Year([GSE by KT plant.Month]),Month([GSE by KT plant.Month]))),-12))

This one is not working!

Thanks,
AS

amit_saini
Honored Contributor III

Re: Month-Year Script help!

Just want to show Nov 2014 till  Oct 2015 inside list box from the above example.

Thanks

AS

Community Browser