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: 
soniasweety
Master
Master

Last year and till date

Hi all,

Sunny T

Lakshmikandh Karthikeyan

I have data like below   and my requirement is

I have filter year and month     if I select  year 2016  and month  aprl

my result should be.    2015 all available sum and  in 2016 jan+feb+mar+aprl

so  previous year sum as one column  2016  jan-aprl sum in one column

   

5 Replies
israrkhan
Specialist II
Specialist II

what if you select 2015 or 2014?

soniasweety
Master
Master
Author

Hi,

user want to select atleast one year once only.

MK9885
Master II
Master II

Create Flags for Previous year and add that Flag in your first condition.

For current year add the data until current month.

Will you be able to share the expression you're using?

adamdavi3s
Master
Master

Create a master calendar and add some flags in there for YTD / LYTD etc

Canonical Date

Fro example:

,YearToDate(Date)*-1 as CurYTDFlag

,YearToDate(Date,-1)*-1 as PriorYTDFlag

,InYear(Date,now(),0)*-1 as CurYearFlag

,InYear(Date,now(),-1)*-1 as PriorYearFlag

Then just use those flags in set analysis.