# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Contributor III

## Need to get field values for the previous year month

Hi All,

Here is my requirement,

The Values in X for the period 2012-04 <> The values in X for the period 2012-03

Need to calculate the previous period (i.e., here 2012-03) using the current selection (i.e., 2012-04) and using that need to calculate the Values in X field for that period.

I am not sure on how to compare the same field's value for the current period and for the previous period.

8 Replies
Valued Contributor II

## Re: Need to get field values for the previous year month

Hi Leni,

Quick read through your question. This is the Set Analysis I will suggest:

=sum({\$<Period = {\$(=only(Period)-1)}>}Sales)

Let me know if this is helpful

Contributor III

## Re: Need to get field values for the previous year month

Hi Gabriel,

Thanks for your solution.

But my requirement is not this.

Let me try to explain my scenario with ur sample.

I need to compare the Values in Sales field of current selection (2012-04) with the values in Sales field of current selection -1 (2012-03) and using that I need to give true or false value. If it not equal then true else false.

This we are doing to check whether any change is happened to the sales field between the selected period (2012-04) and the period-1 (2012-03).

YYYY-MM = 2012 - 04 & 2012-03

Thanks,

Leni

Valued Contributor II

## Re: Need to get field values for the previous year month

Hi Leni,

Kindly try this.

if(sum({2012-04}sales) = sum({2012-03}sales),"No Change","Changes")

If this doesn't work then provide data in excel file and I can look at it again.

Contributor III

## Re: Need to get field values for the previous year month

Its not working..

and my requirement is something different.

For Example,

I am selecting Year - 2012, Month - 04, then in straight table it shows either yes or no by doing below comparison.

I am having a field name 'Group' and this field value might change between period. So when I select 2012-04, I have to compare the field value of Group for the Period 2012-04 with the field value of Group for the Period 2012-03 and if the group name is changed (i.e., Group @ 2012-04 <> Group @ 2012-03) then I have to return as Yes else No.

I will not use aggregate funtion in this.

Thanks,

Leni

Valued Contributor II

## Re: Need to get field values for the previous year month

Can you attached sample data

Contributor III

## Re: Need to get field values for the previous year month

I cannot share the data as it has confidential details.

Not applicable

## Re: Need to get field values for the previous year month

Have you got the answer for this.If so could you please provide me as well.

Thanks,

Swetha

Contributor III

## Re: Need to get field values for the previous year month

Sorry I am yet to get the answer.