Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Please help with the last year values

Hello everyone,

Please help into this, i have one single table, i am getting Last Year values from the same table by using key ( i created the key based on the year and other objects)

Can you please look into the image for the issue.

Untitled.jpg

If you look the value for the 2011 the last year value (2010) is coming properly, but if see 2012 value, the last year value (2011) is not coming properly,


Can any body tell what is the issue.


Thanks in advance

12 Replies
ecolomer
Master II
Master II

You can use ABOVE function or BEFORE function

Not applicable
Author

Thanks for your response Enrique,

Can you please tell me where to use, since i am very new to qlikview.

Thanks

PrashantSangle

Hi,

What expression you are using to calculate last Year Values??

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
ecolomer
Master II
Master II

An simple example

IAMDV
Luminary Alumni
Luminary Alumni

Hi,

It's difficult to help without looking at the object/expression. I'd receommend you to post the sample QVW file and one of us will help you.

Cheers,

DV

www.QlikShare.com

Not applicable
Author

Hi Max, I am getting Last year data by using below code( i wrote at script level)

Table1:

LOAD

Year-1&'-'&Month as %Key1;

Load

     DATE,

     MonthNo,

     Revenue

   

FROM

Table(qvd)

Left Join(Table1)

LOAD

Distinct

Year&'-'&Month as %Key1,

    Revenue as LY_Revenue,

   

FROM

Table1.qvd

i am creating one more qvd , i am using that, when i place year, revenue, LY Revenue, it is having the issue, please look at the screen shot, If you look the value for the 2011 the last year value (2010) is coming properly, but if see 2012 value, the last year value (2011) is not coming properly,

Please help into that

Not applicable
Author

Hi Deepak, I am getting Last year data by using below code( i wrote at script level)

Table1:

LOAD

Year-1&'-'&Month as %Key1;

Load

     DATE,

     MonthNo,

     Revenue

  

FROM

Table(qvd)

Left Join(Table1)

LOAD

Distinct

Year&'-'&Month as %Key1,

    Revenue as LY_Revenue,

  

FROM

Table1.qvd

i am creating one more qvd , i am using that, when i place year, revenue, LY_Revenue, it is having the issue, please look at the screen shot, If you look the value for the 2011 the last year value (2010) is coming properly, but if see 2012 value, the last year value (2011) is not coming properly,

Please help into that

Not applicable
Author

Hi Enrique, I am getting Last year data by using below code( i wrote at script level), i think above and before function i can not use here

Table1:

LOAD

Year-1&'-'&Month as %Key1;

Load

     DATE,

     MonthNo,

     Revenue

  

FROM

Table(qvd)

Left Join(Table1)

LOAD

Distinct

Year&'-'&Month as %Key1,

    Revenue as LY_Revenue,

  

FROM

Table1.qvd

i am creating one more qvd , i am using that, when i place year, revenue, LY Revenue, it is having the issue, please look at the screen shot, If you look the value for the 2011 the last year value (2010) is coming properly, but if see 2012 value, the last year value (2011) is not coming properly,

Please help into that

ecolomer
Master II
Master II

You can use:

Sum({<yourYear=,yourMonth=,YearField = {'$(=Max(YearField)-1)'}>} Sales)