Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ZuhaibRana
Partner - Contributor III
Partner - Contributor III

I want to create YTD, MTD on the month field

I want to create ytd or mtd on my data I have just the month field name in my data so I want to show data as when I select March in the month then it also sums the previous month's data values. Like January value is 100 Feb value is 150 and the March value is 50 when I select March from mtd then it shows a sum of 300 if I select Feb from the month then it shows 250. 

Sample Data Attached in picture

Thanks in Advance

 

Qlik Sense Desktop  

4 Replies
Chanty4u
MVP
MVP

Try this 

YTD

Sum({<MonthField={"<=$(=Max(MonthField))"}>} ValueField)

MTD

Sum({<MonthField={">=$(=MonthStart(Max(MonthField)))"}, MonthField={"<=$(=Max(MonthField))"}>} ValueField)

 

ZuhaibRana
Partner - Contributor III
Partner - Contributor III
Author

how can i create master calendar on the base of month field 

vikasmahajan

Hi,

Here we have script to create master calendar basically you need to find min date & max date & generate set of dates for between perid.

https://community.qlik.com/t5/Member-Articles/SIMPLE-MASTER-CALENDER/ta-p/1484974

 

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.
Rocky6
Creator
Creator

This is a simple calendar you can create.

Calendar:
Load
Min(LAST_UPDATED_DATE) as MinDate,
Max(LAST_UPDATED_DATE) as MaxDate

FROM source

 

Let vMinDate = Date(Floor(Peek('MinDate')),'YYYY-MM-DD');
Let vMaxDate = Date(Floor(Peek('MaxDate')),'YYYY-MM-DD');

Let vStartDate = Date(AddMonths(MonthStart(Date(Floor(Peek('MaxDate')),'YYYY-MM-DD')),-12),'YYYY-MM-DD');
Let vEndDate = Date(Floor(Peek('MaxDate')),'YYYY-MM-DD');

Drop Table Calendar;