Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Question - We have a qlikview server in Germany that another team manages. I developed a dashboard on my local computer and sent them the qvw and qvd files to upload which they have done many times for me before without any hitches. This time my dashboard was a little more complex and had the below routine to generate a calendar and then another line to create a common calendar. This worked with no issues on my local copy but the published version shows no results.
Anyone have any ideas why it would be different on the server vs a local version of qlik?
//===================================================
// Subroutine to Generate Calendar.
//===================================================
SUB CalendarFromField(_field, _calendar, _prefix)
[$(_calendar)]:
// Generate Final Calendar
LOAD
[$(_field)]
,year([$(_field)]) as [$(_prefix)Year]
,month([$(_field)]) as [$(_prefix)Month]
,day([$(_field)]) as [$(_prefix)Day]
,weekday([$(_field)]) as [$(_prefix)Weekday]
;
// Generate range of dates between min and max.
LOAD
date(DateMin + IterNo()) as [$(_field)] // Link Field
WHILE DateMin + IterNo() <= DateMax
;
// Find min and max of date field values.
LOAD
min(datefield)-1 as DateMin
,max(datefield) as DateMax
;
// Load date field values.
LOAD
FieldValue('$(_field)', RecNo()) as datefield
AutoGenerate FieldValueCount('$(_field)');
END SUB
Then CALL CalendarFromField('Date', 'CommonCalendar', ''); to generate the the actual "Common calendar"
It's the first time that you user VBA Macros in Qlikview? Did you allow macro execution on the server?
Could it be that the date formats differ between the Local PC and The Germany based server:
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='£#,##0;-£#,##0';
SET TimeFormat='hh:mm:ss';
SET DateFormat='DD/MM/YYYY';
SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
Ok so again I am a newb here. Is that subroutine a VBA script? Either way I do not know if macro execution is allowed on the server but that is a good idea. I will make sure to ask that on Monday.
I looked at the time settings on the server and compared them to my PC, they are exactly the same for the the time zone, I am UTC -5 or something and they are UTC -1 or something like that but dates are displayed in the same format.
What the subroutine does it create a calendar table with all the dates spanning the interval between the minimum and maximum date in your Datelink.qvd file. That calendar table will have no gaps. Your source data could have missing dates, i.e. gaps in the calendar. But if you know that there are no gaps then you might as well use the Month() and Year() functions directly as you posted above.
Ask for your Server Administrador to look for Server Settings in the QMC (Management Console). There are items to configure macro execution on there.
Look this picture
I believe that is under QMC -> System -> Servers -> QVS
Good luck
The subroutine he posted is not macro code.