Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Fiscal Month vs Previous Fiscal Month

Hi All,

I am facing one Issue in the Comparison of the Current Month vs Previous Month according to the Fiscal Year Issue is that  when I select Apr 2013 then its show the value of the apr 2013 but for the previous month ie Mar 2012 shows zero .

Can any one tell me the solution.??

Regards

Deepak

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Since you have a Date field that I assume contains data values you can try these:

Current month:

sum({<PostingYear=,PostingMonthName=,Date={'>=$(=monthstart(max(Date)))<=$(=monthend(max(Date)))'}>}RMSFGIssueQty)*-1


Previous month:

sum({<PostingYear=,PostingMonthName=,Date={'>=$(=monthstart(max(Date),-1))<=$(=monthend(max(Date),-1))'}>}RMSFGIssueQty)*-1


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Not applicable
Author

Hi deepak,

What expression you are using for calculating Previous Month? Is it just a Month-1 or you are calculating on the basis of Financial year? Can you provide your sample example?

-Yojas

Not applicable
Author

Hi Yojas,

Please find the expression below I am using Financial Year like 2012 ,2013.. its start from the april as I mentioned above I need Current Fiscal Month vs Previous Fiscal Month or It also need to work across the year like when I select Apr 2013 for Current Month its shows the value for April 2013 and In the previous month its will show the value of march 2012.

for the Current Month

sum({<PostingYear={$(=year(yearname(date(max(Date)),0,4)))},PostingMonthName={$(=Month(Max(Date)))}>}RMSFGIssueQty)*-1

for the previous month

=sum({<PostingYear={$(=year(yearname(date(max(Date)),0,4)))},PostingMonthName={$(=month(addmonths((max(Date)),-1)))}>}RMSFGIssueQty)*-1

Not applicable
Author

Hi,

It seems to me your 2nd formula wouldn't bring values of March 2012 but May 2013. You can try:

=sum({<PostingYear={$(=Year(Addmonths(Max(Date),13)))},PostingMonthName={$(=Month(Addmonths(Max(Date),13)))}>}RMSFGIssueQty)*-1

Hope this helps

Gysbert_Wassenaar

Since you have a Date field that I assume contains data values you can try these:

Current month:

sum({<PostingYear=,PostingMonthName=,Date={'>=$(=monthstart(max(Date)))<=$(=monthend(max(Date)))'}>}RMSFGIssueQty)*-1


Previous month:

sum({<PostingYear=,PostingMonthName=,Date={'>=$(=monthstart(max(Date),-1))<=$(=monthend(max(Date),-1))'}>}RMSFGIssueQty)*-1


talk is cheap, supply exceeds demand