Hi Ajay,
Try this:
if (day(currentdate)<=7) then
(
{PROBSUMMARYM1.SUBCATEGORY} in ["Airtel Money", "Airtel Money-IT Application", "Airtel Money-IT Connectivity", "Airtel Money-IT Database", "Airtel Money-IT Hardware", "Airtel Money-IT System", "Airtel Money-Merchant Application", "Airtel Money-Merchant Connectivity", "Airtel Money-Network System", "Airtel Money-Power"] and
{PROBSUMMARYM1.LOCATION} = "KE" and
{PROBSUMMARYM1.OPENED_BY} <> "Auto Ticket Engine" and
{PROBSUMMARYM1.OPENED_BY} <> "Email Ticket" and
not ({PROBSUMMARYM1.ASSIGNMENT} startswith "HP") and
(
Date(dateadd('s',10800,{PROBSUMMARYM1.OPEN_TIME})) IN [Minimum(MonthToDate) TO Date(year(currentdate),month(currentdate)+1,1)-1] OR
Date(dateadd('s',10800,{PROBSUMMARYM1.OPEN_TIME})) IN [DateAdd('d',-7,Maximum(LastFullMonth)), Maximum(LastFullMonth)]
)
)
else
(
{PROBSUMMARYM1.SUBCATEGORY} in ["Airtel Money", "Airtel Money-IT Application", "Airtel Money-IT Connectivity", "Airtel Money-IT Database", "Airtel Money-IT Hardware", "Airtel Money-IT System", "Airtel Money-Merchant Application", "Airtel Money-Merchant Connectivity", "Airtel Money-Network System", "Airtel Money-Power"] and
{PROBSUMMARYM1.LOCATION} = "KE" and
{PROBSUMMARYM1.OPENED_BY} <> "Auto Ticket Engine" and
{PROBSUMMARYM1.OPENED_BY} <> "Email Ticket" and
not ({PROBSUMMARYM1.ASSIGNMENT} startswith "HP") and
Year(dateadd('s',10800,{PROBSUMMARYM1.OPEN_TIME})) = (year(currentdate)) and
Month(dateadd('s',10800,{PROBSUMMARYM1.OPEN_TIME})) = (Month(currentdate)) and
day(dateadd('s',10800,{PROBSUMMARYM1.OPEN_TIME})) > (day(currentdate)- 31)
)
-Abhilash