Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
rp2018
Creator
Creator

How to output records whose date is last day of the month?

Have a source with a column called LDate with YYYY-MM-DD format and wanted to output only records where the date is last day of the month using tmap?

 

What is an expression in tmap to do this?

Labels (2)
4 Replies
TRF
Champion II
Champion II

Assuming LDate is never null, you can use an output filter with the following expression:
TalendDate.compareDate(TalendDate.getLastDayMonth(row1.LDate)) == 0
vapukov
Master II
Master II

use for tMap output or input  filter (if LDate is date - mean marked as date type in tMap)

 

TalendDate.formatDate("yyyy-MM-dd",row1.strDate).equals(TalendDate.formatDate("yyyy-MM-dd",TalendDate.getLastDayOfMonth(row1.LDate)) )

 

 

possible minor syntax check, because of typing from memory

 

vapukov
Master II
Master II


@TRF wrote:
Assuming LDate is never null, you can use an output filter with the following expression:
TalendDate.compareDate(TalendDate.getLastDayMonth(row1.LDate)) == 0

yes sure - it good too, just think it need to fix also

as I remember it require at least 2 or 3 parts, like:

 

TalendDate.compareDate(TalendDate.getLastDayMonth(row1.LDate),row1.LDate,"yyyy-MM-dd"))) == 0

TRF
Champion II
Champion II

@vapukov gives the complete expression.