Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
MarioCenteno
Creator III
Creator III

Current YTD & previous YTD

Hi

Someone can help me with the expressions Current YTD & previous YTD . I need to add the sales of the current year and the previous year.

6 Replies
vamsee
Specialist
Specialist

Please have a look at the following document.

http://community.qlikview.com/docs/DOC-4821 

PabloTrevisan
Partner - Creator II
Partner - Creator II

Hi Mario..

Try this

Actual Year

Sum( { $< [YEARDATE]= {'$(=Max([YEARDATE]))'} > } [SALE] ))

previous year

SUM({<[YEARDATE]={'$(=Max([YEARDATE])-1)'}>}[SALE]))

Gopi_E
Creator II
Creator II

Hi Mario,

Try this

For YTD: Sum({<Year={"=$(=Max(Date))"}>}Sales)

For PYTD: Sum({<Year={"$(=Max(Year)-1)"},Date={"<=$(=Max(Date))"}>}Sales)

MarioCenteno
Creator III
Creator III
Author

Pablo is not working, I was trying to use this expression but it has not worked for me either.


Current expression :

Sum({<

F_IFR=,Year=,Month=,

F_IFR={">=$(=YearStart(addYears(max(F_IFR),-1)))<=$(=addYears(max(F_IFR),-1))"}>}KWH)


PabloTrevisan
Partner - Creator II
Partner - Creator II

Could you send me your qvf?

MarioCenteno
Creator III
Creator III
Author

The expression works but when I select the current month of August, the previous YTD does not accumulate.


Without selecting a month

QLIK 2.png

Selecting a month

QLIK.png