Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
You create a YYYMM field starting from a date field, so let's suppose your date field is SalesDate then
Load
...
SalesDate,
year(SalesDate)*100 + Month(SalesDate) as YearMonthField,
...
Hi Thabiso, as an example, if you have a field named DateField, you can do:
LOAD Date(DateField, 'YYYYMM') as YearMonth
...
Hi Alessandro,
Im trying to Combine two Fields Year and Month Fields to make them as one Field YearMonth
Thanks
Hi Thabiso,
Try this might work.
DateEg:
LOAD ID, Date(Date, 'YYYYMM') As Date;
LOAD * INLINE [
ID, Date
1, 2015-01-01
2, 2015-02-22
3, 2015-08-20
4, 2015-04-22
];
Date(MakeDate(Year, Month), 'YYYYMM') as YearMonth
-Rob
So:
Load
...
Year*100 + Month as YearMonthField,
...
try with rwunderlich suggestion,tht will works 100%.
Hi,
You can use QlikView Date functions like,Date('Date_Field',Format of Date) where you can specify 'YYYYMM'
Hi Shiva,
It dosent work that solution, it makes the Field Blank.