# App Development

Announcements
QlikWorld online is next week! REGISTER NOW
cancel
Showing results for
Did you mean:
Contributor III

## FTD,MTD,YTD (Qlik Sense)

hi,

the date field is FKDAT(taking from sap) and i have linked this with normal Calendar Date as follows

CalendarMaster:

Date(FKDAT) AS FKDAT,

Floor(Date(FKDAT)) AS DateNum,

Year(FKDAT) AS Year,

'Q' & Ceil(Month(FKDAT) / 3) AS Quarter,

Month(FKDAT) As Month,

Day(FKDAT) As Day,

Week(FKDAT) As Week

RESIDENT SAP_Data;

how to find FTD,MTD,YTD for (Sum(Sales)) using set expression .

FTD-  for the day-1

MTD- for the prevoius month

(if current year is January 2017 the it should be show sum of December 2016).

i have to display FTD,MTD,YTD in Table

1 Solution

Accepted Solutions
Master II

Hi Satish

not sure what you want is really called MTD or YTD or more like previous month sale or previous day sale

but the expressions will look more or less like this, Please check your date format

set vMaxDate = =Date(max(FKDAT), 'DD-MM-YYYY');

set vPrevDate = =Date(max(FKDAT)-1, 'DD-MM-YYYY');

set vPrevMonth = =Date(MonthStart(Max(FKDAT), -1), 'MMM')

expressions

Sum({<[FKDAT]={'\$(vMaxDate)'},Year,Month>}Sales)

SUM({<Month={'\$(vPrevMonth)',Year>}Sales)

Learning never stops.
Master II

Hi Satish

not sure what you want is really called MTD or YTD or more like previous month sale or previous day sale

but the expressions will look more or less like this, Please check your date format

set vMaxDate = =Date(max(FKDAT), 'DD-MM-YYYY');

set vPrevDate = =Date(max(FKDAT)-1, 'DD-MM-YYYY');

set vPrevMonth = =Date(MonthStart(Max(FKDAT), -1), 'MMM')

expressions

Sum({<[FKDAT]={'\$(vMaxDate)'},Year,Month>}Sales)

SUM({<Month={'\$(vPrevMonth)',Year>}Sales)

Learning never stops.