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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

MTD PY

Good day!

Please help)

I want to create a flag that will help us analyze the period in last year.

For example, today week №13, Thursday, 27 , the data relevant to the 26.

Need to analyze the period in last year starting on week №13, Thursday and 26 days ago.

This year, I analyze the MTD (1.03.14-26.03.14)

In the previous year - MTD PY (2.03.13-27.03.13)

How to do it?

Thank you very much.

Labels (1)
1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

For Current YearMonth

=SUM({<Date = {'>=$(=MonthStart(Today()))'}>}Sales)

For Previous YearMonth

SUM({<Date = {">=$(=Date(MonthStart(Today(),-12)+1)) <=$(=Date(AddYears(Today(),-1)+1)) "}>}Sales)

Hope this helps...

View solution in original post

5 Replies
MK_QSL
MVP
MVP

For Current YearMonth

=SUM({<Date = {'>=$(=MonthStart(Today()))'}>}Sales)

For Previous YearMonth

SUM({<Date = {">=$(=Date(MonthStart(Today(),-12)+1)) <=$(=Date(AddYears(Today(),-1)+1)) "}>}Sales)

Hope this helps...

Anonymous
Not applicable
Author

Thank you so much, it's works)))

The only thing, I took not current date, but Today()-1, since data actual - always yesterday in our reporting.

SUM({<Дата = {">=$(=Date(MonthStart(Today()-1,-12)+1)) <=$(=Date(AddYears(Today()-1,-1)+1)) "}>}[Объем л.])

Sorry for the perseverance, the last question

it's possibly to make of this expression - the flag and upload it to load, then to use as a filter (MTD PY = {1, 0})

Thank you, thank you, thank you

MK_QSL
MVP
MVP

=SUM({<Date = {'>=$(=MonthStart(Today()-1))'}>}Sales)

For Previous YearMonth

SUM({<Date = {">=$(=Date(MonthStart(Today()-1,-12)+1)) <=$(=Date(AddYears(Today()-1,-1)+1)) "}>}Sales)

Anonymous
Not applicable
Author

Tell, please, one more question: Is it possible to upgrade the MTD PY formulas. 

I need to redo formula. On the last day of the month formula should capture all MTD PY

I mean, when our report will be actual to 31 March 2014, the previous year we should take the period 1 -31 March.

During the month analyze the period via SUM ({<Date = {"> = $ (= Date (MonthStart (Today () -1, -12) +1)) <= $ (= Date (AddYears (Today () -1, -1) +1)) "}>} Sales).

Thanks!

MK_QSL
MVP
MVP

Can you please create a new thread so that other members will also take part !