Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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:
Year & Month as YearMonth
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
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;
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
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".
Hi Gil,
If you are still around please close this thread by checking one answer as Correct, or others as Helpful. Thanks.