14 Replies Latest reply: Sep 19, 2011 2:39 AM by rathish kumar

# Is there any options like YTD? (Year To Date)

In the Time dimension criteria, Is there any option like YTD? How to achieve it?

Regards,

Jeeva.

• ###### Re: Is there any options like YTD? (Year To Date)

YearToDate (timestamp [, year_offset=0 [, start_month = 1 [, ref_timestamp]]])

Should be more explanation in the help section.

Edit:

This returns a boolean for true or false. I believe that if you use:

if(YearToDate(datefield),datefield)

it should return data that is true for the yeartodate function

• ###### Is there any options like YTD? (Year To Date)

there any options like YTD? (Year To Date)

VmaxYear=Max(year field)

VmaxMonth=Max(month field in number)

sum(if( Year=\$(VmaxYear) and Month<=\$(VmaxMonth),Amount))

• ###### Is there any options like YTD? (Year To Date)

Hi,

Use Year to Date function like

YearToDate( date [ , yearoffset [ , firstmonth [ , todaydate] ] ] )

Regards

Anand

• ###### Is there any options like YTD? (Year To Date)

Are you looking to show measures like "Sales (YTD)"? If so I suggest you look at this thread. There are two approaches given which should help you achieve your goal. The first is a DIY solution helping you build the expressions required. The other is a more packaged solution that will also help.

• ###### Is there any options like YTD? (Year To Date)

Dear all,

My data is in Date level, I want that data in Year level for my Dashboard.This was my requirement. How to convert it in Qlikview side not in DB. Can anyone solve this?

Regards,

Jeeva.

• ###### Re: Is there any options like YTD? (Year To Date)

date,

year(date) as Year;

Select *

from ...;

Just create a preceding Load, and just use the format Year(date) to have it return just the year. Also works for Month(date) if you need just the month.

• ###### Re: Is there any options like YTD? (Year To Date)

YearToDate( date [ , yearoffset [ , firstmonth [ , todaydate] ] ] )

Returns true if a date falls within the year to date, else false. If none of the optional parameters are used, the year to date means any date within one calender year from January 1 up to and including the date of the last script execution.

Can Anyone explains this Function,  Year to date(Underlined) refers what?

Regards,

Jeeva.

• ###### Is there any options like YTD? (Year To Date)

So as it says the function returns true or false depending on if the "date" is within the Year to date.

There are some great settings to help you arrive at a wide array of different time preriods and fiscal calendars.

Year offset allows you to evaluate this year, last year, next year, "n" year. -1 will evaluate last year(2010)

First Month allows you to say what month marks the begining of the year depending on your fiscal calendar

Today Date the reference date for "today" the default is the last runtime of the script.

I would use this as part of a calendar dimension table to do something like this

If(Year2Date(CalendarDate,0,1,Today()),1,0) as InCurrentTYD

If(Year2Date(CalendarDate,-1,1,Today()),1,0) as InPriorTYD

I would then use these fields to multiply by my sales to show ytd and pytd sales

• ###### Re: Is there any options like YTD? (Year To Date)

Chriscammers,

Yeah, Thanks.

Regards,

Jeeva.

• ###### Re: Is there any options like YTD? (Year To Date)

Hi,

I got one application where YTD has been defined if it is useful ok

// below code will create last x year YTD sales.

Let vMonthNow = Num(MakeDate(Year(Today(1)), Month(Today(1)), 1));

Let vMonthNowLY = Num(MakeDate(Year(Today(1))-1, Month(Today(1)), 1));

Let vMonthNowL2Y = Num(MakeDate(Year(Today(1))-2, Month(Today(1)), 1));

Let vMonthNowL3Y = Num(MakeDate(Year(Today(1))-3, Month(Today(1)), 1));

Let vMonthNowL4Y = Num(MakeDate(Year(Today(1))-4, Month(Today(1)), 1));

Let vMonthNowL5Y = Num(MakeDate(Year(Today(1))-5, Month(Today(1)), 1));

Let vMonthNowL6Y = Num(MakeDate(Year(Today(1))-6, Month(Today(1)), 1));

Let vMonthNowL7Y = Num(MakeDate(Year(Today(1))-7, Month(Today(1)), 1));

• ###### Re: Is there any options like YTD? (Year To Date)

chriscammers,

How will u achieve fiscal ytd and cal ytd. Can u explain me?

Regards,

Jeeva.

• ###### Re: Is there any options like YTD? (Year To Date)

Hi,

I am sending u a file in that he has defined YTD if it is helpful k

Regards,

Rathish

• ###### Re: Is there any options like YTD? (Year To Date)

Hi ,

I attached one example for YTD Calculation in qlikview side .check this file .

Regards ,

Perumal.A

• ###### Re: Is there any options like YTD? (Year To Date)

Perumal,

I can't see your file. Its telling "No Data to Display" & "Allocated Memory Exceeded". What shall i do for this?

Regards,

Jeeva.