Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

2 Replies
MayilVahanan

Hi,

In Data model script itself, you can try like this

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


And then join with master calendar



Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

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