Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
When i load below script it is givng error as Filed not found <Date>
how to over come dis?
Sample:
LOAD F1 as [s.no],
F2 as [Sales Executive],
F3 as [TopLine Achieved],
F4 as [Gross Margin Achieved] ,
F5 as [Top Line Target] ,
F6 as GMTarget,
F7 as Product,
F8 as BranchHead,
F9 as Branch,
F10 as Dept ,
F11 as Date
// Year(Date) as Year,
// Month(Date) as Month,
// Day(Date) as Day,
// Week(Date) as Week,
// 'Q' & ceil(Num(Month(Date))/3) as Quater,
// applyMap('FiscalQuarterMap', num(month(Date)),null()) AS FiscalQuarter
from[...];
Your dates are in string format use Date#
Sample:
LOAD *,
Year(date#(Date,'DD-MMM-YY')) as Year,
Month(date#(Date,'DD-MMM-YY')) as Month,
Day(date#(Date,'DD-MMM-YY')) as Day,
Week(date#(Date,'DD-MMM-YY')) as Week,
'Q' & ceil(Num(Month(date#(Date,'DD-MMM-YY')))/3) as Quater,
applyMap('FiscalQuarterMap', num(month(Date)),null()) AS FiscalQuarter;
LOAD F1 as [s.no],
F2 as [Sales Executive],
F3 as [TopLine Achieved],
F4 as [Gross Margin Achieved] ,
F5 as [Top Line Target] ,
F6 as GMTarget,
F7 as Product,
F8 as BranchHead,
F9 as Branch,
F10 as Dept ,
F11 as Date
from[...];
Could you upload the sample?
use the initial field name, which is F11
You couldn't access the field Date within the load in which it will be generated - you need to use F11 instead, also:
year(F11) as Year
- Marcus
hi,
Sample qvw
Hi,
mention error not belong to above script.
Are you doing any resident load or using newly created field Date in same load???
Please post complete script.
Regards
Hi Chanty,
Sample:
LOAD F1 as [s.no],
F2 as [Sales Executive],
F3 as [TopLine Achieved],
F4 as [Gross Margin Achieved] ,
F5 as [Top Line Target] ,
F6 as GMTarget,
F7 as Product,
F8 as BranchHead,
F9 as Branch,
F10 as Dept ,
F11 as Date
Year(F11) as Year,
Month(F11) as Month,
Day(F11) as Day,
Week(F11) as Week,
'Q' & ceil(Num(Month(F11))/3) as Quater,
applyMap('FiscalQuarterMap', num(month(Date)),null()) AS FiscalQuarter
from[...];
Regards
try this
Sample:
LOAD *,
Year(Date) as Year,
Month(Date) as Month,
Day(Date) as Day,
Week(Date) as Week,
'Q' & ceil(Num(Month(Date))/3) as Quater,
applyMap('FiscalQuarterMap', num(month(Date)),null()) AS FiscalQuarter;
LOAD F1 as [s.no],
F2 as [Sales Executive],
F3 as [TopLine Achieved],
F4 as [Gross Margin Achieved] ,
F5 as [Top Line Target] ,
F6 as GMTarget,
F7 as Product,
F8 as BranchHead,
F9 as Branch,
F10 as Dept ,
F11 as Date
from[...];
if i use dat ... its working but it is not givng the values in field
i tried that but... its wrkng fyn... but the year and month values are not shwng. its gvng empty field