Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

date as a text

hi all,

sorry for my english, i speak spanish...

i´m using crosstable and the columns are dates. When i see it on QV are in text format. If i export to excel i see as date correctly. here i send excel and script. What can i do to see dates as date format.





Excel

U01/01/200901/02/200901/03/2009
Q50.30950.30950.309
Q50.30950.30950.309
Q50.14650.14650.146
Q64.31464.31464.314


Script

Budget:



CrossTable





(PERIOD, BUDGET, 2)



LOAD

* FROM (biff, embedded labels, header is 1 lines, table is [Budget Ext$] );

THANKS

pablo

1 Solution

Accepted Solutions
Not applicable
Author

Pablo,

I got the answer from one of our Support gurus after trying it it a few times myself:


The values are being interpreted as straight text which means that they won't respond to a date() function which works on a numeric level.You can tell QV to interpret the values numerically by using Num#(). Combining the two should give you proper dates:


date(num#(Period)) as Period


See the attached QVW file for reference. I'm marking this one complete, please let me know if you have any more questions.

View solution in original post

9 Replies
Not applicable
Author

Hi,

Try this. Add a calculated dimension with:

=date(<date filed>,'DD/MM/YYYY')

Have Fun

Alex:)

Not applicable
Author

thanks Alex, but it doesn´t work. All values are null now.

pablo

Not applicable
Author

i think there´s a problem with the cross table; filds called DATE are taken as text and i can´t show them as date.

i don´t know if it´s allow to write somethig when i load the script to format this field as date.

thanks

Not applicable
Author

Hi,

try

=date#(<date filed>,'DD/MM/YYYY')

or

=date(date#(<date filed>,'DD/MM/YYYY'),<Formt code>)

if this doesn't work, you could post an example and we'l see.

Have Fun

Alex:)

Not applicable
Author

Hi Alex, thak you very much again...it doesn´t work...

this is the excel:

SignGroup01/01/200901/02/200901/03/200901/04/200901/05/200901/06/200901/07/200901/08/200901/09/200901/10/200901/11/200901/12/2009
a1456364564645666456964573645786458464591645996460864618646296
a1453154532545345453754541545465455254559545675457654586545975
a1153131532315343153731541315463155231559315673157631586315973
a1354133542335443354733551335563356233569335773358633596336073
a2354163542635446354763551635566356263569635776358663596636076
b2483164832648346483764841648466485264859648676487664886648976
b2843168432684346843768441684466845268459684676847668486684976
b3841328414284162841928423284282843428441284492845828468284792
c3413854139541415414454148541535415954166541745418354193542045
c3522415225152271523015234152391524515252152601526915279152901
c2481354814548165481954823548285483454841548495485854868548795
a1841358414584165841958423584285843458441584495845858468584795
a2483154832548345483754841548465485254859548675487654886548975
a3541215413154151541815422154271543315440154481545715467154781
b1156131562315643156731571315763158231589315973160631616316273
b2186611867118691187211876118811188711894119021191111921119321
c1186131862318643186731871318763188231889318973190631916319273
c3184111842118441184711851118561186211869118771188611896119071


i create a crosstable whit the dates and when i make a date table it appears like this...

39814

39845

39873

39904

39934

39965

39995

40026

40057

40087

40118

40148

if i export the table to excel i see it OK, but at QV it´s a text only...i´ve tried what you said but nothing.

thaks,

pablo.

Not applicable
Author

Pablo,

I'm looking into this as well...I'll post up something soon.

Not applicable
Author

Pablo,

I got the answer from one of our Support gurus after trying it it a few times myself:


The values are being interpreted as straight text which means that they won't respond to a date() function which works on a numeric level.You can tell QV to interpret the values numerically by using Num#(). Combining the two should give you proper dates:


date(num#(Period)) as Period


See the attached QVW file for reference. I'm marking this one complete, please let me know if you have any more questions.

Not applicable
Author

Hi Jason, thak you!!! it worked.

Thank you Alex too. i hope to help you soon.

pablo.

Not applicable
Author

A mi me pasó lo mismo y no me sirvió nada mas que esto (Evaluate):

Map_Extradata:

Directory;

CrossTable(YourDate, Data,3)

LOAD * FROM

[\\telesto\Base para QV\Balance & Cta. Resultados\Datos adicionales resultados.xlsx]

(ooxml, embedded labels, table is Plano);

LOAD

Fila,

Concepto,

Empresa,

Date(Num(Evaluate(YourDate) )) as "Posting Date",

Datos as Amount

Resident Map_Extrasata;

Drop Table Map_Extradata;