Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YTD, PYTD,MTD,PMTD expressions help required.

Hi Friends,

I have below expressions in if-else conditions. Please help me to write the same in SET Analysis.

1) Count(if(Status='Draft' and Type='Type1' and MatterID=NULL() and CREATE_DATE=CALENDER_DATE,Incident_ID))

2) Count(if(Status<>'Draft' and Type='Type1' and MatterID=NULL() and CREATE_DATE=CALENDER_DATE,Incident_ID))

Dear friends, I want to write the above expressions in Year To Date, Previous Year To Date, Month To Date and Previous Month To Date.

I tried with below for one. But it is not working. I don't know where to put and CREATE_DATE=CALENDER_DATE condition.

PYTD:

Count({<Year=, Month=, Quarter=, CALENDAR_DATE=, DateNum={">=$(=Num(YearStart(Max(DateNum), -1)))<=$(=AddYears(Max(DateNum), -1))"}>} Incident_ID)

Please help. Very Very Very urgent requirement.

11 Replies
Not applicable
Author

Thankyou so much Shraddha.

Could you please help me with Current month and Previous Month set analysis expressions as well?

Please help.

shraddha_g
Partner - Master III
Partner - Master III

Try:

MTD

Count({<Year=, Month=, Quarter=, CREATE_DATE={">=$(=Num(MonthStart(Max(CALENDER_DATE))))<=$(=Max(CALENDER_DATE”))"}, Status = {'Draft'},Type={'Type1'},MatterID={NULL()}>} Incident_ID)


Previous Month till date:

Count({<Year=, Month=, Quarter=, CREATE_DATE={">=$(=Num(MonthStart(Max(CALENDER_DATE),-1)))<=$(=AddMonths(Max(CALENDER_DATE), -1)))"}, Status = {'Draft'},Type={'Type1'},MatterID={NULL()}>} Incident_ID)

PYMTD

Count({<Year=, Month=, Quarter=, CREATE_DATE={">=$(=Num(addyears(MonthStart(Max(CALENDER_DATE)),-1)))<=$(=Addyears(Max(CALENDER_DATE), -1)))"}, Status = {'Draft'},Type={'Type1'},MatterID={NULL()}>} Incident_ID)