Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
techvarun
Valued Contributor 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'

Your help is much appreciated

5 Replies
techvarun
Valued Contributor II

Re: YTD Creation

Any ideas?

Re: YTD Creation

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)
bharani8
Contributor III

Re: YTD Creation

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,

effinty2112
Honored Contributor

Re: YTD Creation

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) )

tomasz_tru
Valued Contributor

Re: YTD Creation

Is it possible to use flag on the data model?

Tomasz