Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
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