Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Concatenation of Year and Month From Excel

Hi.

I have an excel sheet

Year     Month

2013     1

2013     2

.

.

.

2014     12

i want to load that table into qlikview.

When i load the script, how do i concatenate the Year and Month into new YearMonth column?

8 Replies
Not applicable
Author

You could also do it in Excel. Plz be more precise, what result do you want? Still 3 fields or 1 field, like YearMonth "2013-1"?

"LOAD Year,

     Month,

     Year & -Month as YearMonth

FROM

..."

Add all fields, gives you something like this:

MK_QSL
MVP
MVP

Year & Month as YearMonth

johnca
Specialist
Specialist

Hi Gil,

To retain a numeric Year-Month try this...

date(makedate(Year,Month),'YYYY-MM') as Year_Month

This will look like 2013-01, 2013-02, etc...

--john

its_anandrjs

If you need month and year as Jan 2013, Feb 2013 and so on then use

Load

Year,

Month,

MonthName(Date(makedate(Year,Month))) as YearMonth

From Location;

johnca
Specialist
Specialist

Even simpler, just change the formatting section from 'YYYY-MM' to 'MMM YYYY' to achieve Jan 2013, Feb 2013, etc...

date(makedate(Year,Month),'MMM YYYY') as Year_Month

It just depends on what you need.

--john

erivera10
Creator
Creator

If you like this date "12/30/2014" then you need to get the year and month, for this you must do so:

"LOAD date_example,

      Month (date_example) as Month,

      Year (date_example) as Year,

      Year '& - &' Month as YearMonth

FROM

... "

But if the date is already separated by day, month and year, just use the field representing each, in this case "month" and "year".

Not applicable
Author

johnca
Specialist
Specialist

Hi Gil,

If you are still around please close this thread by checking one answer as Correct, or others as Helpful. Thanks.