Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
I am facing some issue in scripting can any one correct me.
Syntax error, missing/misplaced FROM:
If(SNO_WEEK=1,'FW' & Right(FISCAL_YEAR_WEEK_NUM,2)),
If(SNO_WEEK >= 1 and SNO_WEEK <= 4,'FW' & Right(Max(FISCAL_YEAR_WEEK_NUM),2) &'-' &'FW' & Right(Min(FISCAL_YEAR_WEEK_NUM),2),
If(SNO_WEEK >= 1 and SNO_WEEK <= 13,'FW' & Right(Max(FISCAL_YEAR_WEEK_NUM),2) &'-' &'FW' & Right(Min(FISCAL_YEAR_WEEK_NUM),2),
If(SNO_WEEK >= 1 and SNO_WEEK <= 52,'FW' & Right(Max(FISCAL_YEAR_WEEK_NUM),2) &'-' &'FW' & Right(Min(FISCAL_YEAR_WEEK_NUM),2),
))))
AS TIMELINE,
Thanks
I Want output like below based on above script.
TIMELINE
--------------
FW30
FW26-FW30
FW18-FW30
Thanks
Just looking at the first line :
If ( SNO_WEEK=1,'FW' & Right FISCAL_YEAR_WEEK_NUM,2 ) ) ,
You have have two pair of brackets so that has ended the if statement. Try removing the final bracket. This may well introduce another error and you'll need to sort any subsequent errors one at time.
Try this:
If(SNO_WEEK=1,'FW' & Right(FISCAL_YEAR_WEEK_NUM,2),
If(SNO_WEEK >= 1 and SNO_WEEK <= 4,'FW' & Right(Max(FISCAL_YEAR_WEEK_NUM),2) &'-' &'FW' & Right(Min(FISCAL_YEAR_WEEK_NUM),2),
If(SNO_WEEK >= 1 and SNO_WEEK <= 13,'FW' & Right(Max(FISCAL_YEAR_WEEK_NUM),2) &'-' &'FW' & Right(Min(FISCAL_YEAR_WEEK_NUM),2),
If(SNO_WEEK >= 1 and SNO_WEEK <= 52,'FW' & Right(Max(FISCAL_YEAR_WEEK_NUM),2) &'-' &'FW' & Right(Min(FISCAL_YEAR_WEEK_NUM),2),
))))
AS TIMELINE,
Regards
Aviral Nag
Yes already I have tried that....but this time getting error as Invalid expression.
Thanks
That error is probably coming from somewhere else in your LOAD statement.
Try commenting out lines from it until it runs without failing and you should be able to find out which is the dodgy line.
Maybe you could post the whole load statement.
CALENDAR:
LOAD SNO_WEEK,
FISCAL_YEAR_WEEK_NUM,
Right(FISCAL_YEAR_WEEK_NUM,2) as WEEK,
If(SNO_WEEK=1,'FW' & Right(FISCAL_YEAR_WEEK_NUM,2),
If(SNO_WEEK >= 1 and SNO_WEEK <= 4,'FW' & Right(Max(FISCAL_YEAR_WEEK_NUM),2) &'-' &'FW' & Right(Min(FISCAL_YEAR_WEEK_NUM),2),
If(SNO_WEEK >= 1 and SNO_WEEK <= 13,'FW' & Right(Max(FISCAL_YEAR_WEEK_NUM),2) &'-' &'FW' & Right(Min(FISCAL_YEAR_WEEK_NUM),2),
If(SNO_WEEK >= 1 and SNO_WEEK <= 52,'FW' & Right(Max(FISCAL_YEAR_WEEK_NUM),2) &'-' &'FW' & Right(Min(FISCAL_YEAR_WEEK_NUM),2),
))))
AS TIMELINE,
SNO_MONTH,
FISCAL_YEAR_MONTH_NUM
// CREATE_DT,
// CREATE_USER_ID,
// LAST_UPDTD_DT,
// F8
FROM
I have checked it line by line....first if statement is fine....after that I was facing issue
Hi SwathiRaj,
I tried to analyse your if structure and found that when SNO_Week = 1 is true, also SNO_Week >=1 and SNO_Week <= 4 and...and SNO_Week >=1 and SNO_Week <= 52 are true. So there is no real alternative.
Seems you should write:
SNO_Week > 1 and SNO_Week <=4,
SNO_Week >4 and SNO_Week <= 13 etc.
Hope this helps
Burkhard
Thax for your reply but it wont work here getting same invalid expression
remove min and max