Forum Discussion
Issues to filter Month
Hi Team, Can you please help me below query to filter Month, Baially i want to filter out current year snapshot with last year max month.
Last 5 Years = if(year(CA_LCR_LMS_HISTORY_001[ACQUIRED_DT])=year(TODAY()) &&CA_LCR_LMS_HISTORY_001[ACQUIRED_DT]=MAX(CA_LCR_LMS_HISTORY_001[ACQUIRED_DT]),1,
(if(year(CA_LCR_LMS_HISTORY_001[ACQUIRED_DT]<YEAR(TODAY()) && MONTH(CA_LCR_LMS_HISTORY_001[ACQUIRED_DT])="Dec"),1,0)))
Hey Anonymous ,
Instead of
&& MONTH(CA_LCR_LMS_HISTORY_001[ACQUIRED_DT])="Dec"),1,0)))
try:
&& Format(CA_LCR_LMS_HISTORY_001[ACQUIRED_DT],"mmm")="Dec"),1,0)))
Basically- the outcome of MONTH(CA_LCR_LMS_HISTORY_001[ACQUIRED_DT]) will be a whole nu,ber month which you are trying to equate with a string value, hence the error
1 Reply
- PC2790Community Champion
Hey Anonymous ,
Instead of
&& MONTH(CA_LCR_LMS_HISTORY_001[ACQUIRED_DT])="Dec"),1,0)))
try:
&& Format(CA_LCR_LMS_HISTORY_001[ACQUIRED_DT],"mmm")="Dec"),1,0)))
Basically- the outcome of MONTH(CA_LCR_LMS_HISTORY_001[ACQUIRED_DT]) will be a whole nu,ber month which you are trying to equate with a string value, hence the error