RobWunderlich / Qlikview-Components

A library for common Qlikview Scripting tasks
197 stars 99 forks source link

Set YTD & MTD #68

Open dajjan opened 6 years ago

dajjan commented 6 years ago

Hi, Im not sure if this is a feature or a issue, but set operator YTD and MTD doesn´t show values in current date at the moment. For example we have a Sales dashboard and our sales-people really like to see there ordervalues in near real time.

At the moment max($(OrderRegvSetYTD) OrderRegDate) shows "2017-10-09"

dajjan commented 6 years ago

Or maybe add CurrentFullYear & CurrentFullMonth :)

dajjan commented 6 years ago

skarmklipp

dajjan commented 6 years ago

Sorry to bother you, all of it sudden it started to work as it should. First the OrderReg_Qvc.Calendar_DateIsFuture stop showing me the "1" on 2017-10-10. And after a few reloads the set analysis included current date. Strange thing, I was thinking that there is someting wrong with my time but this morning it still works..

Maybe there is some varible that needs to be cleared?. I tried to find the issue in Qvc.qvs but the only thing I was able to find was that it depends on the "_f_DateIsFuture" flag.

Im not sure if this is something wrong but I also found: SET __qvctemp.vToday=; shouldn´t there be only on leading underscore?

For info we also need to include these lines in our script after latest release, if not paths doesen´t update.

set vG.BasePath=; set vG.SharedBasePath=;

Regards David

RobWunderlich commented 6 years ago

Yes, the SET should only have one underscore. I'll correct that, but it's just cleanup and shouldn't cause the problem you described.

The current date is established in the load script. Could it be that the script ran before midnight and then you were analyzing on the following day?

dajjan commented 6 years ago

Hi Rob, still having issues around this. See below snapshot. I'm not sure if this came in the QlikSense september release or if this is a bug in the QVC-script.

image

dajjan commented 6 years ago

This is what the MTD set analysis dispays if prited in a textbox:

image

dajjan commented 6 years ago

I found out that the vSetMTD shows different values depending och calandar.

This is the script generating my calendars: CALL Qvc.CalendarFromField('Order.Date', 'OrderCalendar', 'Order.'); CALL Qvc.CalendarFromField('Service.Date', 'ServiceCalendar', 'Service.'); CALL Qvc.CalendarFromField('TerminationNotice.Date', 'TerminationNoticeCalendar', 'TerminationNotice.'); CALL Qvc.CalendarFromField('ContractExpiry.Date', 'ContractExpiryCalendar', 'ContractExpiry.');

image

dajjan commented 6 years ago

This is with QVC 11.1. This is correct but the _isFuture function is not in play..

image

RobWunderlich commented 6 years ago

Is Order.Date a derived field?

dajjan commented 6 years ago

No its not.

dajjan commented 6 years ago

The thing is that QVC 11.1 work just fine and I can set max calendar date to today() to achieve MTD and YTD som not show later values than Today. As you see the TerminationNotice.Date also showing different results depending on QVC version.