Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
LDR
Contributor III
Contributor III

Auto-Calendar: customize and serve it automatically to all apps

Hi everybody,

I want to customize the Auto-Calendar script in order to include some new fields. I know I can do it in each App separately  but, how to configure it if I want to centralize this script and serve it to all new apps?

Thanks in advance for your support

Regards

 

2 Solutions

Accepted Solutions
ft42
Contributor III
Contributor III

  1. You can save your modified Auto-Calendar code in an external script file e.g. AutoCalendar.qss or AutoCalendar.txt, and place it somewhere accessible for Qlik (e.g. FolderConnection)
  2. You can call this script in any app by using include:

$(Must_Include=lib://FolderConnection\AutoCalendar.qss)

              in the data load editor.

To read more about how you store scripts externally and reuse them in apps:

https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/Scripting/SystemVariable...

View solution in original post

ArnadoSandoval
Specialist II
Specialist II

Hi @LDR 

I think you misunderstood my comment, my advice is to develop a single script generating all the Calendar's requirements for your site, but instead of having a QSS script file imported on any application requiring a calendar, I suggest writing a single application generating a single Calendar.qvd, this single calendar qvd accommodate the fields (columns) for each particular set of applications-dashboards in your site, if you look at the diagram below; there are 5 sets of solutions: Finance, Accounting, Payroll, Sales and Human Resources with a single Calendar.qvd servicing all of them; obviously the calendar's need for Finance-Accounting could be different to those of Payroll and Human-Resources; perhaps the latest needs to accommodate useful information regarding holidays and weekend plus other singularities each module has on their own right.

This model has the benefit that all the logic to build calendars is located in one single application-script; at the end of the day, each calendar serve 365 days divided in periods, financial applications could expect 12, 13 or 14 periods, while payroll and human resources may handle their data in weeks, and their weeks could start any day of the week.

My conclusion is the Yes, calendars could be customized per applications needs.

Qlik-Applications-02.png

Hope this helps,

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.

View solution in original post

6 Replies
ft42
Contributor III
Contributor III

  1. You can save your modified Auto-Calendar code in an external script file e.g. AutoCalendar.qss or AutoCalendar.txt, and place it somewhere accessible for Qlik (e.g. FolderConnection)
  2. You can call this script in any app by using include:

$(Must_Include=lib://FolderConnection\AutoCalendar.qss)

              in the data load editor.

To read more about how you store scripts externally and reuse them in apps:

https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/Scripting/SystemVariable...

LDR
Contributor III
Contributor III
Author

Hi FT42

First at all thanks for your reply.

According your comments it will necessary to include the script in each app manually. Is it not possible to say QLIK the Auto-calendar script it must use by default?

Best regards

ArnadoSandoval
Specialist II
Specialist II

@LDR 

Yes, you can have the calendar generating script in a qss file and reference this script  anywhere you need the calendar as explained by Ft42, it works but there is not need to take that approach; there is a second options, you can have an application to just generated the calendar's qvd once, with all the fields you require, then any application or dashboard only need to load the prebuild calendar.qvd; this implementation is easier to maintain, only one application-calendar.qvd generator and anyone else load the existing calendar.qvd

I hope that I explained myself clear, hope this helps,

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.
LDR
Contributor III
Contributor III
Author

Hi ArnadoSandoval,

So according your comments I understand that it's not possible to customize the default Auto-Calendar script for all Apps, isn't it? I mean, once it was customized if any user would create a new App, this App automatically would include the customized script. That's an option but if I will change the script, the change only will affect to the new Apps so maybe the best option is like you and FT42 said.

I will take in mind your approachs.

Thanks

ArnadoSandoval
Specialist II
Specialist II

Hi @LDR 

I think you misunderstood my comment, my advice is to develop a single script generating all the Calendar's requirements for your site, but instead of having a QSS script file imported on any application requiring a calendar, I suggest writing a single application generating a single Calendar.qvd, this single calendar qvd accommodate the fields (columns) for each particular set of applications-dashboards in your site, if you look at the diagram below; there are 5 sets of solutions: Finance, Accounting, Payroll, Sales and Human Resources with a single Calendar.qvd servicing all of them; obviously the calendar's need for Finance-Accounting could be different to those of Payroll and Human-Resources; perhaps the latest needs to accommodate useful information regarding holidays and weekend plus other singularities each module has on their own right.

This model has the benefit that all the logic to build calendars is located in one single application-script; at the end of the day, each calendar serve 365 days divided in periods, financial applications could expect 12, 13 or 14 periods, while payroll and human resources may handle their data in weeks, and their weeks could start any day of the week.

My conclusion is the Yes, calendars could be customized per applications needs.

Qlik-Applications-02.png

Hope this helps,

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.
LDR
Contributor III
Contributor III
Author

Hi ArnadoSandoval,

Your approach is very useful and that was the first option we thought in order to find a solution but I wanted to know if to customize the autoCalendar script and serve it automatically was possible . As you mentioned with your solutions that's not possible so I have the options below: to create my own calendar app and customize it according my needs, to customize a script and import it in each app, etc. Both options can be applied, now I have to decide which one is the one I need.

Thanks a lot for your help

Bye