Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
can anyone help me in correcting this expression plz ,i have no clue where it is going wrong
when i use the Ceil expression(if(ceil(Day/7)>4,4,ceil(Day/7)) as Week) i am getting the values like
1
2
3
4
but what i am looking is
Week1
Week2
Week3
Week4
that is the reason why i am trying this expression
Expression:
If(Day<=7, Dual('Week1', 1),
If(Day<=14, Dual('Week2', 2),
If(Day<=21, Dual('Week3', 3),
If(Day<=31, Dual('Week4', 4))))) as Week
but something is missing from this expression , can suggestion plz
Hi Naveen,
I think you missed to add Field name "Day" in first "If" statement. Try this,
Load *,
If(Day<=7, Dual('Week1', 1),
If(Day<=14, Dual('Week2', 2),
If(Day<=21, Dual('Week3', 3), Dual('Week4', 4)))) as Week,
Dual(Date(Date,'MMMM'),Month(Date(Date,'MMM'))) as Months
Resident Coal;
Drop table Coal;
hi naveen,
kindly add your QVW.
Hi,
i cant do that bro ,
Hi Naveen,
I think you missed to add Field name "Day" in first "If" statement. Try this,
Load *,
If(Day<=7, Dual('Week1', 1),
If(Day<=14, Dual('Week2', 2),
If(Day<=21, Dual('Week3', 3), Dual('Week4', 4)))) as Week,
Dual(Date(Date,'MMMM'),Month(Date(Date,'MMM'))) as Months
Resident Coal;
Drop table Coal;
yes ,my bad thanks for the help