Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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.


Your help is much appreciated

5 Replies
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)
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,

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.



PS This is probably simpler:

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

Valued Contributor

Re: YTD Creation

Is it possible to use flag on the data model?