Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I need your help..
How to write script, if I want to calculate YTD by month selected.
for example:
if I selected year 2014 and month may then accumulation (Jun13 - May14)
or if I selected year 2014 and month apr then accumulation (May13 - Apr 14)
or if I selected year 2013 and month jun then accumulation (Jul12 - Jun13)
Please help me..
thanks & regards..
Hi Jagan,
I want random months selection, example if i selected May14, then Previous Year: Sum Jun12-May13
Hi,
If you want from Jan-13 - Dec-13, then use this
=sum({<Year=, Month=, Date={">=$(=YearStart(Max(Date),-23))<=$(=MonthEnd(Max(Date), -12))"}>}[Measure Field])
Hope this helps you.
If this not works come up with a sample file and expected output.
Regards,
Jagan.
Hi Valdi,
This 'AsOf' Calendar will give you the flags you need to complete this and other types of date analysis.
http://community.qlik.com/docs/DOC-6593
Regards
Richard
QlikCentral.Com
Hi Jagan,
I was try your script, but the numbers accumulate all previous year 2013-2009.
and
I have a script :
sum({<DATE={">$(=addmonths(DATE,-24)) <=$(=addmonths(DATE,-12))"}, YEAR=, MONTH=>} AMOUNT
I think the script is true, because when I checked this script accumulate 12 months of Previous Year.
Btw, Thanks Sir Jagan...
Regards..
Hi Valdi,
Please close this thread by giving Correct and Helpful to the useful posts, this helps others in finding the answers for similar questions.
Regards,
Jagan.
Hi .
Please guide I am searching one expression like if I select Month SEP 2023 then YTD field JAN 2023 TO SEP 2023 DATA sales data will be there using month and year field not date because summary table i am using please help me.