Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Generating a inline table with last date of each month of a year

Hi,

I want to generate an inline table using qv script such that  the table contains     field  Year ,  Month, LastDayMonth,

here is an example

YearMonthLastDayMonth
2012 Jan31-01-2012
2012Feb29-02-2012
2012Mar31-03-2012
2012Apr30-03-2012
2012May31-03-2012
2012Jun30-03-2012
2012Jul31-03-2012
2012Aug30-03-2012
2012Sep31-03-2012
2012Oct30-03-2012
2012Nov31-03-2012
2012Dec31-03-2012

Year can be from 2000 till 2020

can anyone help me out with this.Smiley Happy

Regards,

Tushar 

1 Solution

Accepted Solutions
stephen-a_redmo
Valued Contributor II

Re: Generating a inline table with last date of each month of a year

Hi,

I would do a loop like this:

For y=2000 to 2020

          For m=1 to 12

 

                    Calendar:

                    Load

                              $(y) As Year,

                              Dual(SubField('$(MonthNames)', ';', $(m)), $(m)) As Month,

                              Date(Floor(MonthEnd(MakeDate($(y), $(m))))) As MonthEndDate

                    AutoGenerate(1);

 

          Next

Next

Regards,

Stephen

Stephen Redmond is author of QlikView for Developer's Cookbook

He is CTO of CapricornVentis a QlikView Elite Partner. We are always looking for the right people to join our team.

Follow me on Twitter: @stephencredmond

2 Replies
stephen-a_redmo
Valued Contributor II

Re: Generating a inline table with last date of each month of a year

Hi,

I would do a loop like this:

For y=2000 to 2020

          For m=1 to 12

 

                    Calendar:

                    Load

                              $(y) As Year,

                              Dual(SubField('$(MonthNames)', ';', $(m)), $(m)) As Month,

                              Date(Floor(MonthEnd(MakeDate($(y), $(m))))) As MonthEndDate

                    AutoGenerate(1);

 

          Next

Next

Regards,

Stephen

Stephen Redmond is author of QlikView for Developer's Cookbook

He is CTO of CapricornVentis a QlikView Elite Partner. We are always looking for the right people to join our team.

Follow me on Twitter: @stephencredmond

Not applicable

Re: Generating a inline table with last date of each month of a year

Just what i needed Thanks a lot !

Community Browser