Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

umartareen
Contributor

Multiple Date Fields

Hi,

I made a Cross Table through which I am getting multiple date fields along with other data. How can I convert it to one date field ?

Please find attached.

Thanks in advance

Regards

Umar

8 Replies

Re: Multiple Date Fields

Provide data... You need to use something as below..

Load

  Date(ALT(Date#(Date,'DD/MM/YYYY'),Date#(Date,'DD-MM-YYYY'),Date#(Date,'DD.MM.YYYY'),Date#(Date,'YYYYMMDD'))) as Date

Inline

[

  Date

  01/01/2014

  01-02-2014

  01.03.2014

  20140401

];

engishfaque
Valued Contributor III

Re: Multiple Date Fields

Dear Umar,


Use Alias for converting multiple date fields into one date field.


Table 1:

Date1 as CalenderDate

Table 2:

Date2 as CalenderDate

Kind regards,

Ishfaque Ahmed

Re: Multiple Date Fields

Hi,

Use alt Function as suggested by manish.

have a look at below post.

http://community.qlik.com/blogs/qlikviewdesignblog/2014/04/25/which-conditional-functions-do-you-use

Regards

ASHFAQ

Re: Multiple Date Fields

Use ALT function for this See the example from help

alt(case1[ , case2 , case3 , ...] , else)

The alt function returns the first of the parameters that has a valid number representation. If no such match is found, the last parameter will be returned. Any number of parameters can be used.

Example:

alt( date#( dat , 'YYYY/MM/DD' ),

date#( dat , 'MM/DD/YYYY' ),

date#( dat , 'MM/DD/YY' ),

'No valid date' )

Will test if the field date contains a date according to any of the three specified date formats. If so, it will return the original string and a valid number representation of a date. If no match is found, the text 'No valid date' will be returned (without any valid number representation).

Re: Multiple Date Fields

please attach example.

I am not sure you are talking about different date formats.

Maybe it's just several columns in your table you would like to load using the cross table prefix.

regards

Marco

Re: Multiple Date Fields

Marco Wedel Attachment missing.

Regards

ASHFAQ

umartareen
Contributor

Re: Multiple Date Fields

Hey guys, sorry

Here is the attachment

Re: Multiple Date Fields

Can you provide the expected output you required in Excel Format pls?

Community Browser