Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qvw showing data less than one day evethough the variable has plus one day max - Urgent Help please

Hi,


I have msaccess database table where users logged cases daily every minute/5 minutes. I created qvw to load data into dashboard.


I scheduled the file daily at 12pm. I used to manually upload the database daily at 11:45am to server. So, obviously the qvw needs to show the data upto 11:45am daily.


But I was observing every time  for eg: today is 14/03/2014. The reload of file is success as usual. The data is getting only upto 13/03/2014. This was happening daily. i,e only the qvw can able to read data upto previous date.


I joined access table Dateentered to Clanedar Date.


Because of this shortage in data my users are facing problem to see todays data. Could anyone let me know please why it is showing like that. Is it possible to set this?

I got help from Qlik community. Based on answers I set the Date as below to store in to qvd

LET varMaxDate = Num(Peek('MaxDate', -1, 'MinMax') +1);

On last Friday(14/03/20140 it is fine. But I checked yesterday(17/03/2014) again it is showing data up to 14/03/2014. But the access database contains data upto 17/03/2014.


Please can anyone sort this completely.

Thanks.

8 Replies
Not applicable
Author

Please can anyone suggest me how to set this?

Not applicable
Author

Any help please as I have to set this urgently as my users can not able to see up to date data.

brian_booden
Partner Ambassador
Partner Ambassador

Amelia,

If you are using Peek, did you ensure that the table you are loading from has an Order By clause to sort the records prior to using Peek?  If you don't order by date first, you will just get the date of the last record (whatever that may be) + 1.  I'm guessing that it's just luck you ended up with the right date on 14/03/2014, as a transaction with that date happened to be the last record in the unordered table.

I'm assuming that's not the functionality you want?

Regards,

Brian

Not applicable
Author

Thanks. Where I need to use Order By Clause. Please see below is my script to load master Calendar into QVD

TRACE  Creating Master Calendar;
    
    
/* Load transaction TABLE to get earliest and latest dates */
    
MinMax:

LOAD 
    
Max(TIMESTAMP(DateEnter)) AS MaxDate,    

     Min(TIMESTAMP(DateEnter)) AS MinDate
     FROM
Extractor\TblSales.qvd
(
qvd);


    /* STORE earliest and latest dates in variables */
    
    
LET varMinDate = Num(Peek('MinDate', -1, 'MinMax'));
    
LET varMaxDate = Num(Peek('MaxDate', -1, 'MinMax') +1); 

   /* STORE todays date in variable */
    
    
LET varToday = Num(Today());
          
    
/* Inline TABLE mapping months to quarters */
    
     QuarterMap:
    
MAPPING LOAD * INLINE [
         Month, Quarter
         1, Q1
         2, Q1
         3, Q1
         4, Q2
         5, Q2
         6, Q2
         7, Q3
         8, Q3
         9, Q3
         10, Q4
         11, Q4
         12, Q4
     ]
;
    
    
    
/* Autogenerate every date between varMinDate and varMaxDate while creating calendar fields */
    
    
         
     MasterCalendar
:    

    LOAD*,
          
FiscalYear  & '/ W'  & FiscalWeek    AS  FiscalYearWeek;      
    
LOAD*,
          
YearStart(Date,0,7) AS FiscalYearStart,
          
YearName(Date,0,7) AS FiscalYear,   
          
AUTONUMBER(Year(Date) & Week(Date)) AS FiscalWeekSerial
          
ROUND(num(([Date]+184-(MakeDate(Year(([Date]+184)-mod(([Date]-2),7)+3), 1, (mod(([Date]-2),7)+1) )-10))/7-0.5,'#,##0')) AS FiscalWeek,
           'Q' &
CEIL(if(num(Month(Date))<7,num(Month(Date))+6,num(Month(Date))-6)/3) AS FiscalQuarter;
    
LOAD
                     
Timestamp(Date) as Date_TS,
          
Date#(Date(Date)) AS Date,
          
IF(Date = Today(),1) AS Today,
          
week(Date) AS Week,
          
Year(Date) AS Year,
          
Month(Date) AS Month,
          
Day(Date) AS Day,
          
WeekDay(Date) AS WeekDay,
          
ApplyMap('QuarterMap', Num(Month(Date)), Null()) AS Quarter,
          
Date(MonthStart(Date),'MMM-YYYY') AS MonthYear,
          
Week(Date) & '-' & Year(Date) AS WeekYear,
          
InYearToDate(Date, $(varToday), 0) * -1 AS CurYTDFlag,
          
InYearToDate(Date, $(varToday), -1) * -1 AS LastYTDFlag;      
    
LOAD
          
Date($(varMinDate) + RecNo() - 1) AS Date
    
AUTOGENERATE ($(varMaxDate) - $(varMinDate)+1);                        
    
    
/* DROP Temporary TABLE */
    
    
DROP TABLE MinMax;  
    
    
STORE MasterCalendar INTO C:\Qlikview\MasterCalendar.qvd;
    
    
DROP TABLE MasterCalendar;
    
    






    
    
          
    

Not applicable
Author

It is working fine in personal edition qvw. But the problem is with the qvw which is in server. I changed the reload time from 12pm to 2pm on last Friday(14/03/2014). On Friday it is fine. But since Yesterday(17/03/2014) it is not loading all data instead loading upto previous day.

brian_booden
Partner Ambassador
Partner Ambassador

Are you sure it's the calendar that's the issue?  Have you checked the QVD to ensure it definitely contains the latest transactional data?

Other than that, it sounds a bit like a server date/time issue.  Are the date and time settings on the server the same as your laptop?

Not applicable
Author

I checked the QVD and it ia shwoing maxDate as 18/03/2014.

The server timings are 10:05 18 March 2014

My PC timings are 10:05 18/03/2014

Can you please sort out this.

Not applicable
Author

Is it possible to set this?