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: 
prabhas277
Creator
Creator

about YTD

Hi,

i want to get the previous years data ,,for example ((=sum({<Date={">=$(=YearStart(today()))<=$(=today())"}>}Sales)) this is logic for current year ..by using this syntax how to get previous year.

Thanks in advance

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like:

=sum({<Date={">=$(=YearStart(today(),-1))<=$(=AddMonths(today(),-12))"}>}Sales)

View solution in original post

17 Replies
amit_saini
Master III
Master III

Hi,

1. Current Year

=Sum({$<Month=, Date=, Year={$(=Only(Year))}>} Sales)

or

=sum({<Month=, Date=, Year={$(=max(Year))}>}Sales)

2. Previous Year

=Sum({$<Month=, Date=, Year={$(=Only(Year)-1)}>} Sales)

or

=sum({<Month=, Date=, Year={$(=max(Year)-1)}>}Sales)

Thanks,
AS

tresesco
MVP
MVP

May be like:

=sum({<Date={">=$(=YearStart(today(),-1))<=$(=AddMonths(today(),-12))"}>}Sales)

Not applicable

try like this

=sum({<Date={">=$(=YearStart(today(),-1))<=$(=AddMonths(today()))"}>}Sales)

prma7799
Master III
Master III

Hi Amit,

What is use of =Sum({$<Month=

Thanks

Prashant

amit_saini
Master III
Master III

this is for considering selected Months

Thanks,
AS

prma7799
Master III
Master III

Hi Amit,

Then why we are put blank values

Thanks,

Prashant

amit_saini
Master III
Master III

this will consider all months automatically say for MTD cal.

Thanks,
AS

prma7799
Master III
Master III

means it doesn't accept any value from based on filter we have.

amit_saini
Master III
Master III

Prashantbi,

Please go through this attachment to understand Set analysis.

Thanks,
AS