Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

soniasweety
Valued Contributor III

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

Tags (3)
1 Solution

Accepted Solutions
pritamb89
Contributor

Re: How to create

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
Highlighted
krishna20
Valued Contributor II

Re: How to create

Hi Sony,

You can refer the below link.

Fiscal and Standard Calendar generation

pritamb89
Contributor

Re: How to create

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