Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

How to sum all last year

I want to sum all last year.what should i do.

Tags (1)
14 Replies
MVP
MVP

Re: How to sum all last year

What do you mean by all last year... What you want to sum ? please explain in brief.... Thnx

puttemans
Valued Contributor

Re: How to sum all last year

Please give the community more information on where, with what variables etc.... If you are too general, no-one will be able to help you in a fast and correct manner.

Re: How to sum all last year

I would flag the last year in the script itself and use that within the set analysis to calculate the sum for last year:

=Sum({<LastYearFlag = {'Y'}>} Value)

HTH

Best,

S

datanibbler
Esteemed Contributor

Re: How to sum all last year

Hi Chat,

not too much information, please. That would make it too easy for anyone to help ;-)

Do you want to do that in the script or on the GUI?

Basically, in the script you can do that in an aggregation. On the GUI, you can use Set_analysis.

Best regards,

DataNibbler

Not applicable

Re: How to sum all last year

I have some item. Ex item 1033.I want to some QTY every last year until now.Please.

MVP
MVP

Re: How to sum all last year

SUM({<Year = {'$(=Year(Today()-1)'}>}Qty)

particular for item 1033

SUM({<Item = {'1033'},Year = {'$(=Year(Today()-1)'}>}Qty)

MVP
MVP

Re: How to sum all last year

For this year...use

SUM({<Year = {'$(=Year(Today()))'}>}QTY)

puttemans
Valued Contributor

Re: How to sum all last year

Do you have a sampe of the data, and possibly a dummy of what you'd like to achieve with it?

Not applicable

Re: How to sum all last year

i use this

sum( {$<IvAndTar_YearINVOICEDATE={'$(Y1)'} >} IvAndTar_IV_QTY )

Y1==date(AddYears(date#(IvAndTar_YearINVOICEDATE,'YYYY'),-1),'YYYY')

that code just sum last one year can you suggest me how can i sum all last year.