Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
janardhan
Creator
Creator

LYTD

Hello Friends,

Is this query is correct for lytd

Sum({<TP_Date= {">=$(=Date(YearStart(Max(TP_Date),-1)),'DD-MM-YYYY')<=$(=Date(addyears(Max(TP_Date),-1)),'DD-MM-YYYY')"}>}TP_NetPremium_LC_1)

Pls Help me

2 Replies
MK_QSL
MVP
MVP

LYTD.... corresponds to TODAY()

=SUM({<TP_Date= {'<=$(=AddYears(Today(),-1))>=$(=YearStart(AddYears(Today(),-1)))'}>}TP_NetPremium_LC_1)

LYTD.... corresponds to USER SELECTED TP_Date

=SUM({<TP_Date= {'<=$(=AddYears(Max(TD_Date),-1))>=$(=YearStart(AddYears(Max(TD_Date),-1)))'}>}TP_NetPremium_LC_1)

If this is not working, let me know what is the format of TD_Date and your QlikView one...

SET DateFormat='DD/MM/YYYY';

maxgro
MVP
MVP

you can simplify using flag in calendar as explained here

http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/03/ytd