Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Year difference as a new column in Pivot table

HI,

i need to create a new colum with differece of two years in the chart

i am sharing the app

provide me the solution

1 Solution

Accepted Solutions
varunjain
Creator
Creator

12 Replies
Not applicable
Author

suggestions required

jyothish8807
Master II
Master II

Hi Wow,

     can you please explain a bit more about ur requirment?

Regards

KC

Best Regards,
KC
Not applicable
Author

Capture.PNG.png

Here, i have two columns combo and all pack i need one more column i.e YearDiff column which need to display the differecne of Combo pack and All pack years i.e for combo pack (2013-2012) is 7096-964 = 6132 in YearDIff comumn 2013's value

shorlty i need the difference of year values of both these columns in a new column

jyothish8807
Master II
Master II

Hi,

Try this:

YearCalc:
LOAD YEAR,
     Vendor_Name,
     Category,
     Method,
     Rates
FROM
C:\Users\jyothishk\Desktop\YearCalculaton.xlsx
(ooxml, embedded labels, table is Sheet1);


load *,

if(YEAR<>previous(YEAR),Rates-previous(Rates),'0') as Sub
resident YearCalc
order by YEAR;

Regards

KC

Best Regards,
KC
Not applicable
Author

Hi,

it is not giving the solution

Capture.PNG.png

in the YearDIff comumn 2013's value (2013-2012) is 7096-964 = 6132 like for 2014 aswell

current yr - previous yr's value in the yeardiff column

anbu1984
Master III
Master III

Check this

Not applicable
Author

Thaks anbu  for respondong me

but the suggestion not as per the requirement YearDIff comumn 2013's value (2013-2012) is 7096-964 = 6132

2012 should be empty and from 2013 it should find the diff of 2013-2012 same to  2014 as well

here for dual and total i need two separte columns not in one column

dual year difference in a seperate col and total in a seperate

varunjain
Creator
Creator

THIS WILL HELP FOR SURE.....

Not applicable
Author

Hi Varun

sry to say u missed the accurate result

the requirement

if we chage teh year to column (row to colum) then the DUAL and Total will be seggerated/seperated with the years

i,e in 2012 , 2013, 2014 we will get some values of Dual nad Total with those

now i need to coompare with the Years 2013-2012 and 2014-2013 and result will be pplaced in new column uder the Year 2013 and 2014