Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

Double As

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[...];

1 Solution

Accepted Solutions
Kushal_Chawda

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[...];

View solution in original post

24 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Could you upload the sample?

maleksafa
Specialist
Specialist

use the initial field name, which is F11

marcus_sommer

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

Chanty4u
MVP
MVP
Author

hi,

Sample qvw

PrashantSangle

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

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable

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

Kushal_Chawda

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[...];

Chanty4u
MVP
MVP
Author

if i use dat ... its working  but  it is not givng the values    in field

Chanty4u
MVP
MVP
Author

i tried that but... its wrkng fyn... but  the year and month values are not shwng.    its gvng empty field