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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Create YYYYMM Field from Load

Hi All,

How do i create a new Field that contains Year and Month

e.g

201501

201502

201503

and so on.

Please provide Examples

Thanks.

28 Replies
Not applicable
Author

HI Ruben,

Yes, i didin't clarify on selection, when i say selection, i mean any Field that you select/Choose to use within the Load Script.

rubenmarin

Yes, any field that is a date.

Anyway, as you said from you data (having month as text), you'll need to apply Rob's or Alessandro's suggestions to transform that text into a number.

MarcoWedel

you might have to add this line to your script to be able to interpret your long month names:

SET LongMonthNames = 'January;February;March;April;May;June;July;August;September;October;November;December';



hope this helps


regards


Marco

sasiparupudi1
Master III
Master III

DateMap:

Mapping LOAD * Inline

[

External,Internal

January,1

February,2

March,3

April,4

May,5

June,6

July,7

August,8

September,9

October,10

November,11

December,12

];

Temp:

LOAD Codes,myYear,myMonth,

Date(Date#(trim(myYear)&'-'& ApplyMap('DateMap',Trim(myMonth),Trim(myMonth)),'YYYYY-M'),'YYYYMM') as YYYYMM

Inline [

Codes,myYear,myMonth

0323, 2015,January

0657, 2015,January

0775, 2015,February

0857, 2015,March

];Untitled.png

sasiparupudi1
Master III
Master III

Hi

Please close this thread if you got your answer

Sasi

MarcoWedel

Dear Thabiso,

I noticed that you tend not to close your threads even if you got correct answers. As this would take you only a fraction of the time you expect others to invest in solving your problems, I guess it's not asking to much that you reviewed your threads for correct answers and close those that got one.

thanks

regards

Marco

Not applicable
Author

Hi Marco,

Please Assist im not sure on how to Close them

Please Assist.

Thanks.

sasiparupudi1
Master III
Master III

You close the thread by marking the correct answer as shown in the below picture. Hope this helpsUntitled.png

MarcoWedel

Hi,

you should be able to see this button in the replies to your question.

_Correct.JPG

If you find one answer to solve your problem, just mark it using this button.

thanks

regards

Marco