Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear frnds,
we've an application running in our organzation which consists of two files
1) to create daily qvd : this file concatenates the data daily from an sql table to the qvd built a day before.
While taking the data from table the developer has used floor(Reloadtime()) as Rundate which shud take the numeric part of the day the
application is run and we shud see this date as the maximum date every day in the main application which runs on successful completion of this file.
2) Main application : But the issue for me is instead of showing this maximum date stored in the qvd, the application shows the date of a day before as the maximum date when date(Rundate) is used in the application.
For eg. if the Qvd is created on 12/07/2012 the main application shows 11/07/2012 as the maximum date.
nowhere is he using num(RUNDATE)-1.
And moreover this is what is exactly intended in the application so its not something that needs to be changed, but why is this happening ?
Regards
Hello.
You mean that in the QVD you have data, in which the RunDate is 12/07/2012, but when you display the max in the Main Application, it displays the day before 11/07/2012, and so NOT the max ?
In first look I would say it's not possible, except:
- Set Analysis
- Active selections
Are you sure you have 12/07/2012 in QVD ? If the need is to display the day before, the developer could have found a tricky way to do the day -1.
Hi,
thanks for the reply.
yes, even if the Rundate is 12/07/2012 as max date in qvd generator, the application shows 11/07/2012 as max date
and interestingly while using floor(Reloadtime()) in the qvd generator the developer has added in the comment:
//returns the date of the last reload before the actual one as an integer number.s
I don't know what is happening here.
Regards
I have done test, your results are strange.
Can you create a new application, load the QVD, apply the max on RunDate and display it ? To see if you have same result.
If yes, can you take the QVD application, remove everything except this part, refresh the QVD, then try again with the new application.
If you still have this result, can you share the 2 applications ?
Thanks
Hi qlik_techie.
I stumbled upon the exact same problem with QV10 SR4(?).
I could never figure out why it happened, and I ended up with a comment just as your previous developer did.
//returns the date of the last reload before the actual one as an integer number.s
But this wasn't the reload date, it was another date field.
But anyway, it seems to be connected to the date datatype.
And I ended up having to do date-1.
Kind regards
BI Consultant
Hi,
i'm using QV 10 SR3, i think it's a bug.
Lets have some more comments
Regards
There might be some confusion on ReloadTime() , now(0) and now(1), when used in script vs. UI. Check this:
http://community.qlik.com/message/64953#64953
So, if you run the qvd generator once a day, it wouldn't surprise me if your max rundate is always the day before the current date, if your rundate is set by reloadtime().
Ok?
But what you are saying is, that your actual rundate field contains the current date 12/0/2012, but it is not showing up in the main app? How have you checked that the field contains this value (in the qvd generator app, in the qvd itself?)? How do you display the rundate in the main app? Any chance that you can create and post a small sample app (or two apps and a qvd in your case)?
Regards,
Stefan
That's exactly what I think. If there is a bug in ReloadTime(), ok, not a big deal. But if Qlikview has a bug on function MAX on dates, it's really important to point it.
Dear Stefan Sir,
i'vent yet checked out the link you post. Before that i wud like to answer the questions you've asked.
1) The field Rundate is set by floor(Reloadtime())
2) The table is dropped after qvd is created but a text box is placed in the qvd creator having expression
='Reload Date & Time: ' & Date(ReloadTime(), 'DD/MM/YYYY') & ' at ' & Date(ReloadTime(), 'hh:mm') & 'h.'
which today shows Reload Date & Time:12/07/2012 at 01:00h.
3) if the qvd created above is used in a separate test qvw file the highest/max Rundate available is 41101 which gives 11/07/2012 using date(Rundate)
4) in the main application the date is shown as date(Rundate) as ArchiveDate in script, same as i've used in the test qvw. When the main application is opened the document level trigger on Post reload or On open selects max({1} ArchiveDate) in the field ArchiveDate which also selects 11/07/2012
Regards
Hi,
By MAX date i meant highest/maximum date. i'm not using max(Rundate) in the application.
Its only used in the trigger as mentioned in above post.
I think the test qvw confirms that the issue is with the reloadtime() function as 12/07/2012 doesn't even exist in the qvd
Regards