Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming Aug. 9: New Simplified Authoring for Qlik Sense SaaS – For Details, CLICK HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
everest226
Creator III
Creator III

breaking number to year and week

i have a field    [QVDYEARWEEK] which has value in number    which has year and week attach , how to break this into year and week

LOAD TABLE1

[Good Type],

     [Good Description],

    QVDYEARWEEK

from

---------------

1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

I don't know if TABLE1 is a field name or the table you are loading, so assuming it is the table name, try using a preload statement:

TABLE1:

Load *,

         Mid(QVDYEARWEEK,1,4) as YR,

         Mid(QVDYEARWEEK,5,2) as WK;

LOAD

[Good Type],

     [Good Description],

    QVDYEARWEEK

View solution in original post

2 Replies
jwjackso
Specialist III
Specialist III

I don't know if TABLE1 is a field name or the table you are loading, so assuming it is the table name, try using a preload statement:

TABLE1:

Load *,

         Mid(QVDYEARWEEK,1,4) as YR,

         Mid(QVDYEARWEEK,5,2) as WK;

LOAD

[Good Type],

     [Good Description],

    QVDYEARWEEK

Digvijay_Singh

or directly in the same load like this -

LOAD TABLE1

[Good Type],

     [Good Description],

    Num(Left(QVDYEARWEEK,4)) as Year,

     Num(Right(QVDYEARWEEK,2)) as Weekno