Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am getting an error with the below if statement.
if(DEP_ACCT_OPN_DT >= $(CurrentMonth) and DEP_ACCT_OPN_DT <= $(PreviousMonth)) as FirstMonth,
Note :CurrentMonth is a variable with value set as
date(floor(monthstart(Today()))) .
Many Thanks
if(DEP_ACCT_OPN_DT >= Date(floor(monthstart(Today()))) and DEP_ACCT_OPN_DT <= Date(floor(MonthEnd(Today()))), DEP_ACCT_OPN_DT ) as FirstMonth,
Hi Abhi,
Your if condition is not correct.
Syntax is
If(Expression, return value if condition satisfied, return value if condition not satusfied)
You have an expression but you are not returning anything, the 2nd parameter, the 3rd parameter is optional.
thanks,
Rajesh Vaswani
Hi,
I guess you trying to get date if both the condition is satisfied
try this
if(DEP_ACCT_OPN_DT >= $(CurrentMonth) and DEP_ACCT_OPN_DT <= $(PreviousMonth), DEP_ACCT_OPN_DT ) as FirstMonth,
Hope it helps
Hi
Try like this
if(DEP_ACCT_OPN_DT >= $(CurrentMonth) and DEP_ACCT_OPN_DT <= $(PreviousMonth),DEP_ACCT_OPN_DT ) as FirstMonth
Thank very much for your help but I am getting the error again .
Error in expression:
')' expected
LOAD
DEP_ACCT_NBR,
if(DEP_ACCT_OPN_DT >= =date(floor(monthstart(Today()))) and DEP_ACCT_OPN_DT <= =date(floor(MonthEnd(Today()))), DEP_ACCT_OPN_DT ) as FirstMonth,
DEP_ACT_AGE_DD,
FROM
(biff, embedded labels, table is [Sheet1$])
HI
Try like this
If(DEP_ACCT_OPN_DT >= date(floor(monthstart(Today()))) and DEP_ACCT_OPN_DT <= date(floor(MonthEnd(Today()))), DEP_ACCT_OPN_DT ) as FirstMonth
if(DEP_ACCT_OPN_DT >= Date(floor(monthstart(Today()))) and DEP_ACCT_OPN_DT <= Date(floor(MonthEnd(Today()))), DEP_ACCT_OPN_DT ) as FirstMonth,
Yup,I got the date which i wanted.But I wanted to use a variable istead of the date function in the script.Can u please tell me why is it giving error when I am using variable here.
Thanks again.
Can you please help me with the below if condition.Sorry to bug you.Many thanks for all your help.I appreciate it.
(if(DEP_ACCT_OPN_DT >= Date(floor(monthstart(Today()))) and DEP_ACCT_OPN_DT <= Date(floor(MonthEnd(Today()))), DEP_ACCT_OPN_DT ), 'CurrentMonth',
(if(DEP_ACCT_OPN_DT >= Date(floor(monthstart(Today(),-1))) and DEP_ACCT_OPN_DT <= Date(floor(MonthEnd(Today(),-1))), DEP_ACCT_OPN_DT ) ,'PreviousMonth',
( if(DEP_ACCT_OPN_DT >= Date(floor(monthstart(Today(),-2))) and DEP_ACCT_OPN_DT <= Date(floor(MonthEnd(Today(),-2))), DEP_ACCT_OPN_DT ) , 'PREPreviousMonth'))) as Bucket,
Hi,
How you assigned it to a variable?
Variable Assignment should be
SET CurrentMonth= Date(floor(monthstart(Today())));