# QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

## A subset of measure

Hi!

In my project, there is a field with dates . I need to draw a graph using the last 14 days. Now I use a formula to build measurement : aggr (if (rank ([Date]) < 14 , [Date]), [Date]). This function works , but not quite as much as I would like. If you select multiple values ​​in the filter Date, the graph is redrawn and it remains only the selected values ​​. I want to show always exactly 14 values ​​in this graph.

How can I fix my code?

Thank U!

5 Replies
Honored Contributor II

## Re: A subset of measure

Hi ,

Try like this:

In dimension take date:

In expression:

=sum({<date={"<=\$(=max(date))>=\$(=max(date)-14)"}>}amount)

Hope it works

Regards

KC

Best Regards,
KC
Not applicable

## Re: A subset of measure

I added a picture to illustrate the problem (http://joxi.ru/bmok3ybtdpzRmy).

The graph should show only 14 values in bottom line.

MVP

## Re: A subset of measure

Hi,

Try like this

Dimension: Date

Expression: =Sum({<Date={">=\$(=Date(Max(Date)-13))<=\$(=Date(Max(Date)))"}>} MeasureName)

In the above expression replace MeasureName with your field.

Hope this helps you.

Regards,

Jagan.

Contributor II

## Re: A subset of measure

use alternate state option if you want to keep the same formula in the chart. make this chart with a diffrent state so that other any selection will not effect this chart.

Highlighted
Honored Contributor II

## Re: A subset of measure

Hi,

Did you checked with the dimension limits tab of the chart properties?Under show only drop down-->First,Largest,Smallest options and select limit to 14.

Hope it works.

Keep the expression as : sum(You Value)

Dimension: Date

Regards

KC

Best Regards,
KC