Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
ferha_jafri
Partner - Creator III
Partner - Creator III

Issue with closing month

Hello Everyone,

I have an issue as i have a closing date and closing period fields and my requirement are as when i select the month field the output should be as selected previous month  closing date till the selected month closing date eg

when i select the month jan 13 then it should reply the dates from 29-12-2012 to 26-01-2013 them mentioned dates are closing date for the month dec 12 and jan13 .It is very urgent plz reply ..

Thanks in advance

Ferha Jafri

6 Replies
vikasmahajan

IF you are looking for like wise comparison between closing months then try following

expression

for CY

SUM({$<FinancialYear=,Quarter=,MonthName=,FiscalYear={$(=max(FiscalYear))},

[Posting Date]={">=$(=YearStart(max({$<FiscalYear={$(=max(FiscalYear))}>}[Posting Date]),0,4))<=$(=max({$<FiscalYear={$(=max(FiscalYear))}>}[Posting Date]))"}>} [ YOUR Amount] )

for LY

SUM({$<FinancialYear=,Quarter=,MonthName=,FiscalYear={$(=max(FiscalYear)-1)},

[Posting Date]={">=$(=YearStart(max([Posting Date]),-1,4))<=$(=addmonths(max({$<FiscalYear={$(=max(FiscalYear))}>}[Posting Date]),-12))"}>}[ Your Amount])

Hope This Help You

Good Luck

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

i am not looking for any comparisons i want my month jan to start from last month closing date  to selected month closing date.

vikasmahajan

Current Month (label :=date(max(MonthYear), 'MMM-YYYY') & chr(10) & '(CM)')

sum({$<Year = {$(=max(Year))}, Month = {"<=$(=max({<Year={$(=max(Year))}>} Month))>$(=max({<Year={$(=max(Year))}>} Month)-1)"}>}  LineSalesAmount)

Previous Month (Label : =date(addmonths(max(MonthYear), -1), 'MMM-YYYY') & chr(10) & '(PM)' )

sum({$<Year = {$(=max(Year) - $(=if(max(Month) = 1, 1, 0)))}, Month = {$(=month(addmonths(max(MonthYear), -1)))}>} LineSalesAmount)

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

I have a closing date for every month ... so when i click on month = jan and Year = 2013 then the data should come from

Closing date of the previous month till the closing date of the current month...........

say 20/12/2012 to 29/1/2013... similarly for every month

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

it will be great if some one can attach a sample QVW

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

i am attaching the sample qvw file so that my issue became more clear..