Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
siva_boggarapu
Contributor II

Current Month,Current Quarter, Last Month,Last Quarter?

Hi All,

I have requirement to show Current Month,Current Quarter, Last Month,Last Quarter data in Desiner Part. Can one help me on this?

Thanks,

Siva

4 Replies
MVP & Luminary
MVP & Luminary

Re: Current Month,Current Quarter, Last Month,Last Quarter?

Current Month: =Month(Today())

Current Quarter: =Year(Today())&'Q'&ceil(Month(Today())/3)

Last Month: =Month(monthstart(Today(),-1))

Last Quarter: =Year(monthstart(Today(),-1))&'Q'&ceil(Month(monthstart(Today(),-1))/3)


talk is cheap, supply exceeds demand
siva_boggarapu
Contributor II

Re: Current Month,Current Quarter, Last Month,Last Quarter?

Hi Gysbert,

Thanks for your reply.

My requriement has been changed little again. Actually I have a data only 2010 and 2011.

My requirement is 01-May-2011 need to show as Current Month

lly                        01-APR-2011 need to show as Last Month

Current Quarter            01/04/2011 - 30/06/2011

Previous Quarter          01/01/2011 - 31/03/2011

Thanks,

Siva

MVP & Luminary
MVP & Luminary

Re: Current Month,Current Quarter, Last Month,Last Quarter?

Hi Siva,

Try like this in script

Data:

LOAD

*,

AddMonths(AddYears(DateFieldName, 3), 2) AS NewDate

FROM DataSource;


Now use the new field for your analysis.

Regards,

Jagan.

Not applicable

Re: Current Month,Current Quarter, Last Month,Last Quarter?

Try something like this

Instead of Today() use Max(Date) like

Current month : month(max(Date))