Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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.
Not applicable

Adding Current year with previous year max month?

Hi All,

I want to add current year 12 month with previous year max month(means 12 th month).

for ex:

i selected financial year 2015(Apr-Mar)

i want to add ---Mar-2014+currnt year all months(from Apr to Mar)

How to pick the previous year value when i selected current year.

Urgent plz help on this.

Thanks,

Ashok.

1 Solution

Accepted Solutions
sudeepkm
Valued Contributor III

Re: Adding Current year with previous year max month?

I think you can keep the value in a variable like below. and then use the variable in the expression with the rest of the current year values.

sum({<Year={"$(=Max(Year)-1)"},Months={Mar} >} Price)

// I hard coded the month value as Mar was the highest as per your business logic

2 Replies
MVP
MVP

Re: Adding Current year with previous year max month?

If you are having a year field, you could try like:

=Sum({<Year+={"$(Max(Year)-1)"}>} Sales)

sudeepkm
Valued Contributor III

Re: Adding Current year with previous year max month?

I think you can keep the value in a variable like below. and then use the variable in the expression with the rest of the current year values.

sum({<Year={"$(=Max(Year)-1)"},Months={Mar} >} Price)

// I hard coded the month value as Mar was the highest as per your business logic

Community Browser