Announcements
Product Release Webinar: Qlik Insider airing December 6! REGISTER TODAY!
cancel
Showing results for
Did you mean:
Specialist II

## YTD Creation

Hi Qlixperts,

My Financial year is between Oct- Sep,

I need to store all the months in between the YTD Start and Current month-1 in a variable to use the same in a set analysis.

For Eg: YTDStart : OCT

Current Month : July

I want to store all the Months between Oct to June (CurrentMonth-1) in a variable like this.

vYTD:'Oct','Nov','Dec','Jan','Feb','Mar','Apr','May','Jun'

5 Replies
Specialist II
Author

Any ideas?

Steps followed

1) I think you need to set up Fiscal Year for Oct - Sep

2) The variable should be this?

Sum({<Month = {">=\$(=Min(Month)) <= \$(=Max(Month)-1)"}>}Sales)

Or use NumberField for them and replace Month to NumberField

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Creator III

Few months back.. i have created a Qtr wise in the script itself.. May be this logic will be helpful in urs..

My year is like 201601.. 201602

left(mnthclosetime,4)+ if(right(mnthclosetime,2)>=11,1,0)&'-'& 'Q' & ceil(match(Month(makedate(left(mnthclosetime,4),right(mnthclosetime,2),'01')),'Nov','Dec','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct')/3) as Year_Subs_Quarter,

Master

Hi Varun,

Try this expression to give the Fin Year:

if (Ceil(Month(Date) / 3)<4,Year(Date)-1 & '/' & Year(Date), Year(Date) & '/' & Text(Year(Date)+1) )

For Date = 01/09/2017 the expression returns 2016/2017.

Regards

Andrew

PS This is probably simpler:

if (Month(Date) <10,Year(Date)-1 & '/' & Year(Date), Year(Date) & '/' & Text(Year(Date)+1) )

Specialist

Is it possible to use flag on the data model?

Tomasz

Community Browser