Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert do date

I have a table by name COSB_AGM

there are many fileds in this table which are like wkgoo1

so i want to convert this in dat formate

iam trying this way but its not working

wkgoo1 as 01-12-2014 its giving error in the script  and i tried like this also

wkg001 as 01/12/2014 but to its not taking ,

what do i need to do to achieve this ?

regards

here is the script  i want to achieve in date

COSB_AGM:

LOAD

[Object number_OBJNR],

[Value/Obj. Crcy_WOG001] as 01,04,2014 ,

     [Value/Obj. Crcy_WOG002]  as 01,05,2014 ,

     [Value/Obj. Crcy_WOG003] as  01,06,2014 ,

     [Value/Obj. Crcy_WOG004]  as 01,07,2014,

     [Value/Obj. Crcy_WOG005]as 01,08,2014 ,

     [Value/Obj. Crcy_WOG006] as 01,09,2014,

     [Value/Obj. Crcy_WOG007]as 01,10,2014 ,

     [Value/Obj. Crcy_WOG008] as 01,11,2014,

     [Value/Obj. Crcy_WOG009] as 01,12,2014,

     [Value/Obj. Crcy_WOG010] as 01,01,2014,

     [Value/Obj. Crcy_WOG011] as 01,02,2014,

     ([Value/Obj. Crcy_WOG012]+

     [Value/Obj. Crcy_WOG013]+

     [Value/Obj. Crcy_WOG014]+

     [Value/Obj. Crcy_WOG015]+

     [Value/Obj. Crcy_WOG016]) as 01,03,2014

    

     Resident COSB;

    

   STORE COSB_AGM into COSB_AGM.qvd ;

10 Replies
prma7799
Master III
Master III

Hi,

Can you post some sample data?

Thanks

Prashant

PrashantSangle

Hi,

[Value/Obj. Crcy_WOG002] as 01,05,2014 ,

Here you are using , which will never work

Try with [] or ''

try like

[Value/Obj. Crcy_WOG002] as '01-05-2014' ,

or

[Value/Obj. Crcy_WOG002] as [01-05-2014] ,

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
robert_mika
Master III
Master III

Duplicate?

Date

it maybe useful for someone trying to answer your question.

anbu1984
Master III
Master III

Are you trying to rename the field names?

[Value/Obj. Crcy_WOG001] as 01,04,2014

Is this [Value/Obj. Crcy_WOG001] string or date field? Do you want to change date format?

Not applicable
Author

it has numerical values and i want to convert it to date and month  out of it

Not applicable
Author

Hi,

try like

[Value/Obj. Crcy_WOG002] as '01-05-2014' ,

or

[Value/Obj. Crcy_WOG002] as [01-05-2014] ,

anbu1984
Master III
Master III

Can you post sample values of [Value/Obj. Crcy_WOG001]?

jagan
Partner - Champion III
Partner - Champion III

Hi,

I am not sure why you are renaming the fields in this format, instead you can format in a meaningful way like Week1, Week2,   OR 2014-01, 2014-02.....

If you want to give the same name you can try giving [] like below

COSB_AGM:

LOAD

[Object number_OBJNR],

[Value/Obj. Crcy_WOG001] as [01,04,2014] ,

     [Value/Obj. Crcy_WOG002]  as [01,05,2014] ,

     [Value/Obj. Crcy_WOG003] as  [01,06,2014] ,

     [Value/Obj. Crcy_WOG004]  as [01,07,2014],

     [Value/Obj. Crcy_WOG005]as [01,08,2014] ,

     [Value/Obj. Crcy_WOG006] as [01,09,2014],

     [Value/Obj. Crcy_WOG007]as [01,10,2014] ,

     [Value/Obj. Crcy_WOG008] as [01,11,2014],

     [Value/Obj. Crcy_WOG009] as [01,12,2014],

     [Value/Obj. Crcy_WOG010] as [01,01,2014],

     [Value/Obj. Crcy_WOG011] as [01,02,2014],

     ([Value/Obj. Crcy_WOG012]+

     [Value/Obj. Crcy_WOG013]+

     [Value/Obj. Crcy_WOG014]+

     [Value/Obj. Crcy_WOG015]+

     [Value/Obj. Crcy_WOG016]) as [01,03,2014]

   

     Resident COSB;

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

hi jagan mohan thanks for your reply ,

after doing this iam using the cross table to get month out of this date format for which iam using the cross table .

.is is possible to get month out of this after cross table  ? look this is what iam doing below . there are totally two tables after which i need to inner them and get month out of this date .

Cosb_Resident:

LOAD

     [Object number_OBJNR], 

     [Val/COArea Crcy_WKG001] as '01-04-2014' ,

     [Val/COArea Crcy_WKG002] as '01-05-2014',

     [Val/COArea Crcy_WKG003] as '01-06-2014',

     [Val/COArea Crcy_WKG004] as '01-07-2014',

     [Val/COArea Crcy_WKG005] as '01-08-2014',

     [Val/COArea Crcy_WKG006] as '01-09-2014',

     [Val/COArea Crcy_WKG007] as '01-10-2014',

     [Val/COArea Crcy_WKG008] as '01-11-2014',

     [Val/COArea Crcy_WKG009] as '01-12-2014',

     [Val/COArea Crcy_WKG010] as '01-01-2014',

     [Val/COArea Crcy_WKG011]  as '01-02-2014',

     ([Val/COArea Crcy_WKG012]+[Val/COArea Crcy_WKG013]+

     [Val/COArea Crcy_WKG014]+

     [Val/COArea Crcy_WKG015]+

     [Val/COArea Crcy_WKG016]) as '01-03-2014'

     Resident COSB;

    

     Store Cosb_Resident into Cosb_Resident.qvd;

    

     Drop Table Cosb_Resident ;

Project_Billing: 

     CrossTable(month, [Project Billing Value])

LOAD [Object number_OBJNR],

     Date#([01-04-2014]) as Apr,

     Date#([01-05-2014]) as May ,

     Date#([01-06-2014]) as jun,

     Date#([01-07-2014]) as Jul,

     Date#([01-08-2014]) as Aug,

     Date#([01-09-2014]) as Sep,

   Date#( [01-10-2014]) as Oct,

    Date#([01-11-2014]) as Nov,

    Date#( [01-12-2014])as Dec,

     Date#([01-01-2014]) as jan,

     Date#([01-02-2014]) as Feb,

     Date#([01-03-2014]) as Mar

FROM

(qvd);