# New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

## Only show the last 12 months

Hello everyone,

Im creating a chart which displays the amount of new debtors per month. However, I want to only show the last 12 months in my chart and can't seem to fix it with a dimension limit.

This is the line of code I use to define the debtor start date and also use this as my month filter in the chart:

*

, Month(Debtor_StartDate) & '/' & Year(Debtor_StartDate) as Debtor_StartMonth

Date(Min(Date_Key)) as Debtor_StartDate

from

[.......]

Tags (5)
1 Solution

Accepted Solutions
Not applicable

## Re: Only show the last 12 months

I found a solution to my problem
This is what I added into the script and then used a Set Analysis to get in right into the graph.

Script:
If(Date <= Today() And Date >= SetDateYear(Today(), Year(Today())-1), 1, 0) As Last12Months

Set Analysis:

=Count({< Last12Months = {1}>} Debtor_StartDate)

4 Replies
Honored Contributor II

## Re: Only show the last 12 months

Dimension limit really won't possible and it won't help for you

Create chart and use dim as month

and expression is

Sum({<Month = {">=AddMonths(Max(Month),-12) <=Max(Month)"}>}Measure)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Not applicable

## Re: Only show the last 12 months

I found a solution to my problem
This is what I added into the script and then used a Set Analysis to get in right into the graph.

Script:
If(Date <= Today() And Date >= SetDateYear(Today(), Year(Today())-1), 1, 0) As Last12Months

Set Analysis:

=Count({< Last12Months = {1}>} Debtor_StartDate)

New Contributor II

## Re: Only show the last 12 months

Thank you so much for this Ivo. It looked so easy but have spent all morning working on it.