Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change Number date to Name

I have attempted three different script addons with my data load to get my month dates that currently show 201301, etc to show Jan 2013.  How do I do this?

11 Replies
Anonymous
Not applicable
Author

Kari

How about:

     MonthName(date#('201301','YYYYMM'))

Best Regards,     Bill Markham

vgutkovsky
Master II
Master II

Try this: date(date#(fieldname,'YYYYMM'),'MMM YYYY')

Regards,

Vlad

Not applicable
Author

hi

try this

Date(Date#(datefield,'YYYYMM'),'MMM YYYY')

Not applicable
Author

Hello,

Try this:

MonthName(MakeDate(Left('201301',4),Right('201301',2),1))

MonthName(MakeDate(Left(Field,4),Right(Field,2),1))

Not applicable
Author

Thanks all but I keep getting and unknown script error. I'm pulling my data from a BWSAP Cube,. I'm not working with a flat file I can manipulate easily. I am thinking it has to do with the base data not having the month name as an option?

Anonymous
Not applicable
Author

Kari

Can you get the basic data from your BWSAP Cube loaded into QlikView without errors?

  • Ignoring any date format manipulation

If you can then paste your load script into here so we can see it & hopefully make relevant suggestions.

Best Regards,     Bill

Not applicable
Author

Yes, my base data loads as it should, error free. It was once I started creating charts that I noticed the dates.

Directory;

LOAD COMP_CODE.COMP_CODE as [Company Code],

     NET_WGT_DL as [Net Weight/Vol],

     FCNETVALUE as [Net Value Shipment],

     DISTANCE,

     [/BIC/ZGD_CNT] as Counter,

     ZRECPLANT.ZRECPLANT as [Receiving Plant],

     ZSHP_PLAN.ZSHP_PLAN as [Shipping Plant],

     DEL_TYPE.DEL_TYPE as Delivery ,

     SHIP_COND.SHIP_COND as Mode,

     [ZCONDTYPE./BIC/ZCONDTYPE],

     [ZCONDUNIT./BIC/ZCONDUNIT],

     PROFIT_CTR.PROFIT_CTR as [Profit Center],

     PLANT.PLANT as Plant,

     MATERIAL.MATERIAL as Material,

     [ZVEHICLE./BIC/ZVEHICLE],

     CURRENCY.CURRENCY as Currency,

     FCDOCCRNCY.FCDOCCRNCY,

     CALDAY.CALDAY as Day,

     CALMONTH.CALMONTH as Month, //Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sept, Oct, Nov, Dec,

     CALYEAR.CALYEAR as Year,

     FISCPER.FISCVARNT as [Fiscal Variant],

     FISCPER.FISCPER as [Fiscal Year Period],

     FISCPER3.FISCPER3 as [Fiscal Period],

     WEEKDAY1.WEEKDAY1 as Weekday,

     [COMP_CODE./BIC/ZGRPCOMP]

I did attempt this as well:

[Calendar]:

load dual(String,Num) as Month inline

[String,Num

Jan,1

Fev,2

Mar,3

Apr,4

May, 5

Jun,6

Jul,7

Aug,8

Sep,9

Oct,10

Nov,11

Dec,12];

Not applicable
Author

Hello,

I've worked with BWSAP and SAP R3 and these formulas works because time format doesn't matter, the data is considered as text

MonthName(MakeDate(Left('201301',4),Right('201301',2),1))

MonthName(MakeDate(Left(Field,4),Right(Field,2),1))

best regards.

Not applicable
Author

Perhaps I am putting it in my script wrong then?  When I add this into my script I get an "unknown statement" error - as I did with all the other suggestions.