Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ferha_jafri
Partner - Creator III
Partner - Creator III

YTD for fiscal previous year

Hello Everyone,

I have issue with YTD fiscal year which starts from jul to june the issue is that when i writing YTD expression the dates are showing fine but when i am checking for it for previous year the values are not mathich.

1 Solution

Accepted Solutions
vikasmahajan

Hii Ferha,

try following expression

SUM({$<FiscalYear={$(=max(FiscalYear)-1)},YEAR_MONTH=p(YEAR_MONTH_PREVIOUS),[Posting Date]={'<=$(vLMaxDate)'},FinancialYear=,MonthName= >}  [Sales Amount])

1.  YEAR_MONTH_PREVIOUS  is filed to create in calender master is as follows

     num((Year(TempDate)-1)&num(Month(TempDate),'00')) AS YEAR_MONTH_PREVIOUS, // Link between tables for                            previous month / year selection

2. vLmaxdate  is variable

=date(addyears(max([Posting Date]), -1), 'DD/MM/YYYY')

Hope this helps you for previous year ytd  vs curr year ytd  ( Like wise comparison)

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.

View solution in original post

3 Replies
sujeetsingh
Master III
Master III

Can you post a sample !!

vikasmahajan

Hii Ferha,

try following expression

SUM({$<FiscalYear={$(=max(FiscalYear)-1)},YEAR_MONTH=p(YEAR_MONTH_PREVIOUS),[Posting Date]={'<=$(vLMaxDate)'},FinancialYear=,MonthName= >}  [Sales Amount])

1.  YEAR_MONTH_PREVIOUS  is filed to create in calender master is as follows

     num((Year(TempDate)-1)&num(Month(TempDate),'00')) AS YEAR_MONTH_PREVIOUS, // Link between tables for                            previous month / year selection

2. vLmaxdate  is variable

=date(addyears(max([Posting Date]), -1), 'DD/MM/YYYY')

Hope this helps you for previous year ytd  vs curr year ytd  ( Like wise comparison)

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
ferha_jafri
Partner - Creator III
Partner - Creator III
Author

thanks for everyone's reply.