# New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

## Set analysis expression for year to month analysis

Hi,

I've a table with a year_and_month as a dimension and an amount as a measure. For my analysis, I have used a pivot chart.

I've put the year_and_month field on a list box. For my measure, in the pivot chart I've specified this set analysis expression:

sum({\$<year_and_month = {"<=\$(=\$(vYearMonth))"}>} Amount).

When I select an unique value in year_and_month list box, I have the right result, thus the rows in pivot with year_and_month value equals to, fe, 201101, 201102, but when I select 201003 and 201102 I have 201001, 201002, 201003 and 201101, 201102, 201103 in the pivot, but the expected result for the 2011 year is 201101 and 201102 not 201103.

How can I solve this issue, please? Many thanks

5 Replies
Valued Contributor III

## Set analysis expression for year to month analysis

Honored Contributor

## Set analysis expression for year to month analysis

What is the expression in 'vYearMonth'? Which dimensions did you include in your chart?

Not applicable

## Set analysis expression for year to month analysis

Hi, thanks.

Year_and_month is a dimension in the pivot chart and there is another dimension (fe employee code).

vYearMonth is a variable. This variable contains all the selected values for year_and_month.

Thanks

Honored Contributor

## Set analysis expression for year to month analysis

You shouldn't use '<='. Try this:

sum({\$<year_and_month = {"<\$(=\$(vYearMonth))"}>} Amount).

or you let me rewrite, please try:

sum({\$<year_and_month = {"<\$(=max (vYearMonth ) )"}>} Amount).

Not applicable

## Set analysis expression for year to month analysis

Hi, Eric,

I've tried the sum({\$<year_and_month = {"<\$(=\$(vYearMonth))"}>} Amount) expression, but unsuccessfully. Why do I need to change ...<=\$... in ...<\$...? I don't understand this passage.

The core of this issue is that I can select more one values for year_and_month and I must show for the specific selected year the months between january and the selected month.

In other terms, if I select year_and_month = 201003 and year_and_month = 201102 I must show on the pivot:

• 201001, 201002, 201003;
• 201101, 201102.

Thanks