Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
I have given the below expression to obtain quarter field and from date field called Month.but I get the below result as
'Quarter' & ceil(month(Month)/3) as Quarter ,
quarter |
Quarter |
Quarter1 |
Quarter2 |
Quarter3 |
Quarter4 |
Here I do not want the value Quarter how do I modify this to get the below result
quarter |
Quarter1 |
Quarter2 |
Quarter3 |
Quarter4 |
please can someone help me out to resolve this??
sahana
Hi,
Check list values of Month, I thiks there are an "blank" or similar
For that you can create a table with:
Month Q
where Month is your values and Q is ceil(month(Month)/3)
Hi Enrique,
I checked,there are no blanks,null etc in the list of month in the excel sheet.How do I proceed,please guide.
Sahana
I think you should have rows in your excel worthless.
do the following, stand in the next row to the last valid value and delete all lines to the end
hi,
its actually taking the data directly from database.Is there a way to restrict the blanks in the script level while using this function??
sahana
Hi,
I think for some records the Months are missing that is why you are getting just Quarter, if you want to remove those then try like this
LOAD
*,
If(Len(Trim(Month)) > 0, 'Quarter' & ceil(month(Month)/3)) as Quarter
FROM DataSource;
The above script assigns null to Quarter which is having no month value.
Hope this helps you.
Regards,
Jagan.
if(Month>0, 'Quarter' & ceil(month(Month)/3, Null()) as Quarter
thanku all I learnt something new.
Hi,
Please close this thread.
Regards,
jagan.