Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

satish25
New Contributor III

FTD,MTD,YTD (Qlik Sense)

hi,

please help me out to find the fields FTD,MTD,YTD.

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

CalendarMaster:

LOAD

    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
pradosh_thakur
Valued Contributor III

Re: FTD,MTD,YTD (Qlik Sense)

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)

1 Reply
pradosh_thakur
Valued Contributor III

Re: FTD,MTD,YTD (Qlik Sense)

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)

Community Browser