Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

How to create

Hi All,

I have a date field in my data   like

OrderDate

20-06-2016

.......to

02-03-2018   [till date]

I want to create a variables like below. to calculate  sum(sales)   for last fiscal year  and current fiscal year

my fiscal year is-   Aprl-to Mar

vCurrentYear=

vLastYear=

vFiscalYear=

vLast10Months=

vLast18Months=

how to create this?

Thanks

Sony

1 Solution

Accepted Solutions
jerryyang756
Creator
Creator

Have you created the Calender from OrderDate ?  If not ,then first create the calender. Go through the above link provided by @KALYAN KRISHNA. then

vCurrentYear= Year(Max(Year))

vLastYear=Year(Max(Year))-1

vFiscalYear= Max(FisCalYear) // You have to calculate in Load Script

vLast10Months=  >=$(=Min({<Year={'$(=Max(Year)-1)'}>}DATE)) <=$(=AddMonths(Max(DATE),-10))

vLast18Months= >=$(=Min({<Year={'$(=Max(Year)-1)'}>}DATE)) <=$(=AddMonths(Max(DATE),-18))

View solution in original post

2 Replies
krishna20
Specialist II
Specialist II

Hi Sony,

You can refer the below link.

Fiscal and Standard Calendar generation

jerryyang756
Creator
Creator

Have you created the Calender from OrderDate ?  If not ,then first create the calender. Go through the above link provided by @KALYAN KRISHNA. then

vCurrentYear= Year(Max(Year))

vLastYear=Year(Max(Year))-1

vFiscalYear= Max(FisCalYear) // You have to calculate in Load Script

vLast10Months=  >=$(=Min({<Year={'$(=Max(Year)-1)'}>}DATE)) <=$(=AddMonths(Max(DATE),-10))

vLast18Months= >=$(=Min({<Year={'$(=Max(Year)-1)'}>}DATE)) <=$(=AddMonths(Max(DATE),-18))