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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trouble with date format

I have the following load on one dashboard

SALES:Directory;QUALIFY *;UNQUALIFY ControlDate,;

LOAD Status,

.....

[Decision Date] as [Global Award Date],

[Phase Since],

....

  if(Status = 'Open', [Decision Date],
        
if(Status = 'Won', [Decision Date]
           
if(Status = 'Lost', [Decision Date],date([Phase Since])))) as ControlDate FROM [$(QVDPath)Sales.xlsx] (ooxml, embedded labels, table is SAPBW_DOWNLOAD);

I have a second load on a different dashboard:

Revenue:Directory;QUALIFY *;UNQUALIFY ControlDate;

LOAD [Opportunity ID]

.....

[Decision Date],

[Phase Since],

....

if(Status = 'Open', date([Decision Date]),
        
if(Status = 'Won', date([Decision Date]), 
           
if(Status = 'Lost', date([Decision Date]),date([Phase Since])))) as ControlDate
         FROM

(
ooxml, embedded labels, table is SAPBW_DOWNLOAD);

I have a Calendar:

Range:LOAD
    
num(date('01/04/2008')) as startdate, //######## CHANGE HERE ########     max(ControlDate) as enddate //######## CHANGE HERE ########resident SALES;  //######## CHANGE HERE ########

//Peek out the values for later uselet vStart = peek('Range.startdate',-1,'Range')-1;let vEnd = peek('Range.enddate',-1,'Range');let vRange = $(vEnd) - $(vStart);//Remove Range table as no longer neededDrop table Range;
//Generate a table with a row per date between the range aboveDate:UNQUALIFY *;Load
    
$(vStart)+recno() as Dateautogenerate $(vRange);
//Calculate the Parts you need to examineDateParts:load
    
Date as [ControlDate], //######## CHANGE HERE ########     date(Date,'dd/mm/yyyy') as FullDate,

.......

resident Date;

I used the Calendar on both dashboards ( but I change the  resident from SALES to Revenue)

The first version works but the second does not.

With the second version the control date comes out like 01/01/2011 rather than in the first dashboard which is like 39541 (which I assume is a Julian date)

The input fields Decision date and Phase Since are exactly the same on both of the source spreadsheets (Format General).  I tried date([Decision  Date]) on the second dashboard but to no effect.

Does anyone have a suggestion where the differenvce might lie?

Regards

Jason

10 Replies
Not applicable
Author

Vijay,

Thanks it is now a Julian date. That really was rather a stupid mistake to make..... sorry!

Thanks for your help and thank you to Stefan and Miguel.

Regards

Jason