Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
simonqv16
New Contributor III

Make new fields after binary load of data model

Hi,

I am very new to QlikView.  I would like to make a date field from a text field after binary load of a QVW, so that I can use it to calculate YTD or Rolling-12-month sales.  The text field value is now showing such as 201611, 201612,etc, could anyone know how to make it to a "date" as one new field in the data model and then use it as a master calendar.  Thanks.

Simon

Tags (1)
2 Replies

Re: Make new fields after binary load of data model

Hi,

In Data model script itself, you can try like this

Date(Date#(DateFieldinText,'YYYYMM'),'YYYYMM') as Date


And then join with master calendar



Highlighted
simonqv16
New Contributor III

Re: Make new fields after binary load of data model

The statement added as below where "AE.M_Date" is the text field name in the the ABC.qvw., but the "Date" not created. What should do to fix it?

Binary C:\ABC.qvw;

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='£#,##0.00;-£#,##0.00';

SET TimeFormat='hh:mm:ss';

SET DateFormat='MM/DD/YY';

SET TimestampFormat='MM/DD/YY hh:mm:ss[.fff]';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

Load

Date(Date#(AE.M_Date,'YYYYMM'),'YYYYMM') as Date