Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help Mapping Date from Number

Hi Guy's

Not sure how to do this but i have  tables not joined on date but have numbers like this FREC0001-12, 12 for the year 2012 up to 2015. I would like to map all the numbers with 12 at the end to a year 2012 ect.

Is this possible ?

Regards

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

When you load the table create a new field containing the year, if the fields in tha tables have the same name tha tebles will be joined. to do this:

Load

   ....

   myfield

   2000 + Right(myField,2) as myYear

   ....

let me know

View solution in original post

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

When you load the table create a new field containing the year, if the fields in tha tables have the same name tha tebles will be joined. to do this:

Load

   ....

   myfield

   2000 + Right(myField,2) as myYear

   ....

let me know

petter
Partner - Champion III
Partner - Champion III

If you have a field already denoting the year - like for instance Year then this will link your table with the special field to these years:

LOAD

     .......

     myField,

     '20' & Right( myField , 2 ) AS Year,

    ....

FROM

    .....;

myField containing values like 'FREC0001-12' etc...

Anonymous
Not applicable
Author

can you share your sample application?

Not applicable
Author

Thank you so so much Alessandro

Used

Load

   ....

   myfield

   2000 + Right(myField,2) as myYear

and worked perfectly.

Kind regards

MarcoWedel

Hi,

if the presence of the '-' separator is also important, then one solution could be:

QlikCommunity_Thread_167488_Pic1.JPG

LOAD *,

    Year(Date#(SubField(Field1,'-',2),'YY')) as Year

Inline [

Field1

FREC0001-12

FREC0001-13

FREC0002-12

FREC0002-13

FREC0001

FREC0002

FREC0003

];

hope this helps

regards

Marco