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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik Server vs Desktop

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"

16 Replies
Not applicable
Author

It's the first time that you user VBA Macros in Qlikview? Did you allow macro execution on the server?

awhitfield
Partner - Champion
Partner - Champion

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';

Not applicable
Author

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.

Not applicable
Author

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.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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.


talk is cheap, supply exceeds demand
Not applicable
Author

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

server.png

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The subroutine he posted is not macro code.


talk is cheap, supply exceeds demand