Macro’sare bad!
Why you should never use macro’s
Qlik Dev Group NL – October 29th 2015
Not sure if …
Qlik Dev Group NL – October 29th 2015
AGENDA
1
2
4
3
Introduction
Developing macro’s
What reference materials are there?
How can you debug macro’s?
What are macro’s?
Where can you find them?
What are the language options?
What use cases are there?
5Some cool and/or useful macro’s
How are we and others using macro’s?
Macro’s myths
Is it true what they say?
2
ABOUTBARRYHARMSEN
1 BI Consultant
Working at Bitmetric. Started 15 years ago
in ‘traditional’ Data Warehousing and
Business Intelligence. Switched to Qlik in
2008 and still enjoying it very much.
2 Blogger
Regular blogger at www.qlikfix.com,
together with my colleagues. Focused on
Qlik, with topics ranging from common
challenges to the extremely obscure (some
would say pointless).
3 Author
Authored the book QlikView 11 for Developers
together with Miguel García.
4 Organizer of Qlik Dev Group NL
Started organizing meetup for Qlik
professionals in March 2015. Hobby/fun
project. Help, speakers and sponsors welcome!
3
Qlik Dev Group NL – October 29th 2015
WHATIS A MACRO?
“Asingle instruction that expands automatically into a set of instructions to perform a particular task. ”
Scriptto automate a series of steps in QlikView
Found under Tools | Edit Module (Ctrl + M)
VBScript JScript
4
Qlik Dev Group NL – October 29th 2015
MACRO USE CASES
Sowhat can you use macro’s for?
Qlik Dev Group NL – October 29th 2015
5
MACROUSE CASES (1/2)
Custom scriptfunctions Custom chartfunctions Reportgeneration Front-endinteractivity
Create additional
functions that can be
used in the QlikView
script.
Create additional
functions that can be
used in front-end charts.
Generate reports by
making selections and
exporting data and/or
images to Excel,
PowerPoint, Word,
HTML, etc.
Provide additional front-
end interactivity, for
example dynamically
modifying charts or
selections, calling a web
service etc.
6
Qlik Dev Group NL – October 29th 2015
MACROUSE CASES (2/2)
Cache warming Mass updates Dynamicupdate Developmentautomation
Timed script that
automatically makes
selections on big server
documents. Ensures that
the results are already
cached for the users.
Perform an ad-hoc mass
update of document,
sheet or object
properties across an
application.
Dynamically insert or
update values into the
QlikView data model.
Automate common
developer tasks, for
example generation of
ad-hoc report objects, or
document layout and
navigation.
7
Qlik Dev Group NL – October 29th 2015
MACROUSE CASE CUSTOMSCRIPTFUNCTIONS
Create additional functions that can be used in the QlikView script.
Examples
Regular Expressions*, Levenshtein Distance, SHA-1 hashing*
Alternative: dump table to CSV during reload and process
externally (R, Python, Perl)
8
Qlik Dev Group NL – October 29th 2015
* See: http://www.qlikfix.com/2010/10/18/regular-expressions-in-the-load-script/ for example
** See: http://www.qlikfix.com/2012/06/06/check-if-your-linkedin-password-was-leaked/ for example
Good idea? Depends
Requires some additional tweaking touse
Set AllowMacroFunctionsInExpressions to 1
Found in Easter Egg menu: Help | About QlikView | Right-click Q
MACROUSE CASE CUSTOMCHARTFUNCTIONS
Use additional macro functions within expressions in the front-end.
9
Qlik Dev Group NL – October 29th 2015
Good idea? No, unless…
MACROUSE CASE REPORTGENERATION
Export QlikView data and objects into external reports, for example in PDF, PowerPoint,
Excel, Word or HTML.
Can be done from within the application, butalso externally
Qlik Dev Group NL – October 29th 2015
Good idea? Depends
Example included in presentation files
10
Macro’s are run bythe user using button/text object, or by using
triggers.
Many macro’s do not work in AJAX client, OnPostReload trigger doesn’t
work on server. Can have stability issues or just plain confuse the user.
MACROUSE CASE FRONT-ENDINTERACTIVITY
Add additional ‘pyrotechnics’ to the QlikView front-end, for example changing chart
properties at run time, adding/modifying expressions, etc.
11
Qlik Dev Group NL – October 29th 2015
Good idea? No!
Example included in presentation files
MACROUSE CASE CACHE WARMING
Open a (large) document on the QlikView Server and ensure that common user
selections have been made (and cached), before the ‘real’ users log in.
Cache warming improves ‘perceived’ performance
It’s a good idea to first try to improve the actual
performance of an app before using cache warming.
Alternatives: QV Scalability Tools* or Selenium
Qlik Dev Group NL – October 29th 2015
Good idea? Sort of, better alternatives out there
*QV Scalability Tools can be downloaded here: https://community.qlik.com/docs/DOC-6658
12
When other solutions do not work, macro’s can be useful todomass
updates
Alternatives: Search & Replace expressions, Search & Replace across Prj-
files, Format Painter, applying themes, etc.
MACROUSE CASE MASS UPDATES
Perform an ad-hoc mass update of documents, sheets or objects. Across an application,
or across multiple applications.
13
Qlik Dev Group NL – October 29th 2015
Good idea? Yes, but be careful, better safe than sorry
Example included in presentation files
MACROUSE CASE DYNAMICUPDATES
Dynamically insert or update rows in the QlikView data model.
Trickle load datainto the data model
Partial alternative: Partial Reload
Qlik Dev Group NL – October 29th 2015
Good idea? No, just don’t use Dynamic Updates
Example included in presentation files
14
A lazy efficient developer is a good developer!
Minimize time on non-value added activities, so you can spend more
time on the things that really matter.
MACROUSE CASE DEVELOPMENTAUTOMATION
Automate common developer/designer tasks. For example exporting and importing
variables, creating ad-hoc analysis objects, creating navigation and layout object.
15
Qlik Dev Group NL – October 29th 2015
Good idea? Yes, a very good idea!
See http://www.qlikfix.com/2013/09/06/importing-and-exporting-variables/ for an example
DEVELOPING MACRO’S
Reference materials anddebugging
Qlik Dev Group NL – October 29th 2015
16
Qlik Dev Group NL – October 29th 2015
17
DEFAULT DEVELOPMENT ENVIRONMENT
Built-in Module Editor
• Found under Tools | Edit Module
• No-frills
• Kind of a pain to work with
Debugging?
Virtually non-existent, besides
writing values to a message box.
Qlik Dev Group NL – October 29th 2015
18
ALTERNATIVEDEVELOPMENT ENVIRONMENT
VbsEdit
• Stand-alone VBScript IDE
• IntelliSense
• Object Browser
• Compile to EXE
Debugging?
Plenty! Add breakpoints, inspect
values and objects at runtime, etc.
What’s the catch?
Not free, costs 49 Euro. Download from http://www.vbsedit.com/
Qlik Dev Group NL – October 29th 2015
19
REFERENCEMATERIALS
API Guide
• Provided by Qlik
• Lists simplified object model
• Describes methods and
properties
• Nice collection of sample
macro’s
Check out other people’s stuff
• QlikCommunity
• Blogs Download from https://community.qlik.com/docs/DOC-2640
Qlik Dev Group NL – October 29th 2015
20
DEVELOPMENT TIPS
Use Option Explicit
Forces the explicit declaration of all variables.
Use descriptive variable names
So not xyz but wbExport or chProps.
Comment your code
Needs no further explanation, just do it already.
Don’t misuse On Error Resume Next
Only use for error handling, not to mask crappy code
Write reusable subroutines
Compartmentalize functionality so that you can reuse it
across applications, i.e. not “one big subroutine”.
Qlik Dev Group NL – October 29th 2015
21
SYSTEMACCESS
When dealing with macro’s that access the system (i.e. stuff outside of QlikView),
don’t forget to enable System Access in the Module Editor.
Requested Module Security shows access level requested by the developer.
Current Local Security shows the access level granted by the user.
Qlik Dev Group NL – October 29th 2015
22
INCLUDING MACRO’S
The macro editor doesn’t have the $(include) option that we can use in regular
QlikView script, but we can simulate it, with a macro.
Uses the ExecuteGlobal command.
Allows you to store your macro’s in
external VBS files and include them into
your applications. Useful for version
control.
Read more at http://www.qlikblog.at/509/simulating-include-command-qlikview-macros/
MACRO MYTHS
Busted? Ornot?
Qlik Dev Group NL – October 29th 2015
23
Qlik Dev Group NL – October 29th 2015
24
MACROMYTHS
Macro’s are single-threaded
SOMEWHAT
Macro code is executed sequentially (i.e. “single-threaded”) but
each statement can be multi-threaded.
Qlik Dev Group NL – October 29th 2015
25
MACROMYTHS
Macro’s clear the cache
FALSE
Any selection that is made by a macro is cached in the same way
as a regular selection made in the UI.
Qlik Dev Group NL – October 29th 2015
26
MACROMYTHS
Macro’s clear the undo/redo stack
TRUE
Changing document, sheet or object properties in a
macro will clear the undo/redo stack.
COOL MACRO’S
Sowhat’s being done with macro’s?
Qlik Dev Group NL – October 29th 2015
27
Qlik Dev Group NL – October 29th 2015
28
DOCUMENTANALYZER
• Analyzes the structure of a QVW
• Focuses on which fields are used
and where
• Can be used to tune
performance of QlikView
applications or investigate
impact of data changes
• Made by Rob Wunderlich
Download from http://qlikviewcookbook.com/tools/
Qlik Dev Group NL – October 29th 2015
29
COPYGROUPS UTILITY
• Copy cyclic and drill-down
groups from one QlikView
application to another.
• Yes, it’s Rob again
Download from http://qlikviewcookbook.com/tools/
Qlik Dev Group NL – October 29th 2015
30
QLIKVIEW MACROCOLLECTION
Collection of macro’s by Lucian Cotea
Examples for:
• Exporting JPEG’s
• Exporting to Excel
• Sending emails
• Setting Autozoom
• Creating variables
• and lots of other stuff
https://luciancotea.wordpress.com/2013/07/18/qlikview-macros-useful-collection/
Qlik Dev Group NL – October 29th 2015
31
TURBOQLIK
Internal Bitmetric tool, used for:
• Template / layout generation
• Color management
• Variable management
• Ad-hoc report object generation
• Object library
• And whatever makes our life easier
THANK
YOU!
CONTACTINFO
Telephone, Address, Email,Social Media, etc.
Qlik Dev Group NL – October 29th 2015
33
SOCIAL MEDIA
Twitter Google+ LinkedIn
https://twitter.com/meneerharmsen https://plus.google.com/+BarryHarmsen http://www.linkedin.com/in/barryharmsen
Qlik Dev Group NL – October 29th 2015
34
CONTACT INFO
Bitmetric B.V.
Planetenweg 5
2132 HN, Hoofddorp
TheNetherlands
barry@bitmetric.nl
+31 (0)23 2302 062
+31 (0)62 4581 706
35
Qlik Dev Group NL – October 29th 2015

More Related Content

PDF
Qlik Sense for Beginners - www.techstuffy.com - QlikView Next Generation
PDF
QlikView & Salesforce
PPSX
BI & Analytics in Action Using QlikView
PPTX
Oh! Session on Introduction to Qlikview
PDF
QlikView in the Enterprise
PDF
Qlikview-online-training | Qlikview Server training | Qlikview Designer
PDF
Qlik-Education-Catalog-EN
DOC
Qlik project methodology handbook v 1.0 docx
Qlik Sense for Beginners - www.techstuffy.com - QlikView Next Generation
QlikView & Salesforce
BI & Analytics in Action Using QlikView
Oh! Session on Introduction to Qlikview
QlikView in the Enterprise
Qlikview-online-training | Qlikview Server training | Qlikview Designer
Qlik-Education-Catalog-EN
Qlik project methodology handbook v 1.0 docx

What's hot (20)

PDF
TIQ Solutions - QlikView Data Integration in a Java World
PDF
What makes QlikView unique
PPTX
QlikView projects in Agile Environment
PPT
Best Practices - QlikView Application Development
PDF
QlikView licensing and pricing guidelines 2012
PDF
QlikView Tutorial For Beginners | What Is QlikView | Qlikview Tutorial | Qlik...
PDF
Qonnections2015 - Why Qlik is better with Big Data
PDF
Associative analytics
PPTX
Discover the QlikView Way
PDF
Simplifying the OpenAPI Development Experience
PDF
What's New in QV11: Mobile, Social, Comparative Analysis
PDF
How to Achieve Data in Motion Expertise | Mario Sanchez, Confluent
PDF
GPCloud ( GP on PKS)
PDF
Running Data Platforms Like Products
PDF
LIVE DEMO: Pivotal Cloud Foundry
PDF
Webinar Data Mesh - Part 3
PDF
Quantum metrics
PPTX
Dutch Oracle Architects Platform - Reviewing Oracle OpenWorld 2017 and New Tr...
PDF
Using Pivotal Cloud Foundry with Google’s BigQuery and Cloud Vision API
PPTX
Ensuring Cloud Native Success: Organization Transformation
TIQ Solutions - QlikView Data Integration in a Java World
What makes QlikView unique
QlikView projects in Agile Environment
Best Practices - QlikView Application Development
QlikView licensing and pricing guidelines 2012
QlikView Tutorial For Beginners | What Is QlikView | Qlikview Tutorial | Qlik...
Qonnections2015 - Why Qlik is better with Big Data
Associative analytics
Discover the QlikView Way
Simplifying the OpenAPI Development Experience
What's New in QV11: Mobile, Social, Comparative Analysis
How to Achieve Data in Motion Expertise | Mario Sanchez, Confluent
GPCloud ( GP on PKS)
Running Data Platforms Like Products
LIVE DEMO: Pivotal Cloud Foundry
Webinar Data Mesh - Part 3
Quantum metrics
Dutch Oracle Architects Platform - Reviewing Oracle OpenWorld 2017 and New Tr...
Using Pivotal Cloud Foundry with Google’s BigQuery and Cloud Vision API
Ensuring Cloud Native Success: Organization Transformation
Ad

Similar to QlikView Macro's Are Bad (20)

PDF
Better code, faster with kubernetes in google cloud
PDF
Weave GitOps - continuous delivery for any Kubernetes
PDF
Pydata 2020 containers meetup
PDF
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
PDF
Tech leaders guide to effective building of machine learning products
PDF
GraalVM and Oracle's Documentation Trends.pdf
PPTX
Javascript Toolkit
PDF
Velocity NY 2018 "The Cloud Native Developer Workflow"
PDF
Mihai Criveti - PyCon Ireland - Automate Everything
PDF
MuleSoft Surat Virtual Meetup#6 - MuleSoft Project Template Using Maven Arche...
PPTX
SUG Bangalore - Kick Off Session
PDF
Global Azure Bootcamp: Container, Docker & Kubernetes Basics
PDF
What I Learned At Drupal Con Dc 2009
PDF
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
PDF
Google Tech Talk with Dr. Eric Brewer in Korea Apr.27.2015
PPTX
Drupalcon Sessions about Devops
PDF
Boston Data Engineering: Kedro Python Framework for Data Science: Overview an...
PDF
FORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
PPTX
Model repositories: will they become reality?
PDF
Effective Kotlin Best Practices Marcin Moskala
Better code, faster with kubernetes in google cloud
Weave GitOps - continuous delivery for any Kubernetes
Pydata 2020 containers meetup
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Tech leaders guide to effective building of machine learning products
GraalVM and Oracle's Documentation Trends.pdf
Javascript Toolkit
Velocity NY 2018 "The Cloud Native Developer Workflow"
Mihai Criveti - PyCon Ireland - Automate Everything
MuleSoft Surat Virtual Meetup#6 - MuleSoft Project Template Using Maven Arche...
SUG Bangalore - Kick Off Session
Global Azure Bootcamp: Container, Docker & Kubernetes Basics
What I Learned At Drupal Con Dc 2009
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Google Tech Talk with Dr. Eric Brewer in Korea Apr.27.2015
Drupalcon Sessions about Devops
Boston Data Engineering: Kedro Python Framework for Data Science: Overview an...
FORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
Model repositories: will they become reality?
Effective Kotlin Best Practices Marcin Moskala
Ad

Recently uploaded (20)

PPTX
modul_python (1).pptx for professional and student
PPT
Image processing and pattern recognition 2.ppt
PPTX
IMPACT OF LANDSLIDE.....................
PDF
Microsoft Core Cloud Services powerpoint
PPTX
QUANTUM_COMPUTING_AND_ITS_POTENTIAL_APPLICATIONS[2].pptx
PPT
Predictive modeling basics in data cleaning process
PPT
DU, AIS, Big Data and Data Analytics.ppt
PPTX
sac 451hinhgsgshssjsjsjheegdggeegegdggddgeg.pptx
PPTX
Introduction to Inferential Statistics.pptx
PPTX
SET 1 Compulsory MNH machine learning intro
PPTX
STERILIZATION AND DISINFECTION-1.ppthhhbx
PDF
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
PPTX
CYBER SECURITY the Next Warefare Tactics
DOCX
Factor Analysis Word Document Presentation
PDF
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
PPTX
Managing Community Partner Relationships
PDF
Transcultural that can help you someday.
PDF
Optimise Shopper Experiences with a Strong Data Estate.pdf
PPTX
Topic 5 Presentation 5 Lesson 5 Corporate Fin
PPTX
Business_Capability_Map_Collection__pptx
modul_python (1).pptx for professional and student
Image processing and pattern recognition 2.ppt
IMPACT OF LANDSLIDE.....................
Microsoft Core Cloud Services powerpoint
QUANTUM_COMPUTING_AND_ITS_POTENTIAL_APPLICATIONS[2].pptx
Predictive modeling basics in data cleaning process
DU, AIS, Big Data and Data Analytics.ppt
sac 451hinhgsgshssjsjsjheegdggeegegdggddgeg.pptx
Introduction to Inferential Statistics.pptx
SET 1 Compulsory MNH machine learning intro
STERILIZATION AND DISINFECTION-1.ppthhhbx
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
CYBER SECURITY the Next Warefare Tactics
Factor Analysis Word Document Presentation
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
Managing Community Partner Relationships
Transcultural that can help you someday.
Optimise Shopper Experiences with a Strong Data Estate.pdf
Topic 5 Presentation 5 Lesson 5 Corporate Fin
Business_Capability_Map_Collection__pptx

QlikView Macro's Are Bad

  • 1. Macro’sare bad! Why you should never use macro’s Qlik Dev Group NL – October 29th 2015 Not sure if …
  • 2. Qlik Dev Group NL – October 29th 2015 AGENDA 1 2 4 3 Introduction Developing macro’s What reference materials are there? How can you debug macro’s? What are macro’s? Where can you find them? What are the language options? What use cases are there? 5Some cool and/or useful macro’s How are we and others using macro’s? Macro’s myths Is it true what they say? 2
  • 3. ABOUTBARRYHARMSEN 1 BI Consultant Working at Bitmetric. Started 15 years ago in ‘traditional’ Data Warehousing and Business Intelligence. Switched to Qlik in 2008 and still enjoying it very much. 2 Blogger Regular blogger at www.qlikfix.com, together with my colleagues. Focused on Qlik, with topics ranging from common challenges to the extremely obscure (some would say pointless). 3 Author Authored the book QlikView 11 for Developers together with Miguel García. 4 Organizer of Qlik Dev Group NL Started organizing meetup for Qlik professionals in March 2015. Hobby/fun project. Help, speakers and sponsors welcome! 3 Qlik Dev Group NL – October 29th 2015
  • 4. WHATIS A MACRO? “Asingle instruction that expands automatically into a set of instructions to perform a particular task. ” Scriptto automate a series of steps in QlikView Found under Tools | Edit Module (Ctrl + M) VBScript JScript 4 Qlik Dev Group NL – October 29th 2015
  • 5. MACRO USE CASES Sowhat can you use macro’s for? Qlik Dev Group NL – October 29th 2015 5
  • 6. MACROUSE CASES (1/2) Custom scriptfunctions Custom chartfunctions Reportgeneration Front-endinteractivity Create additional functions that can be used in the QlikView script. Create additional functions that can be used in front-end charts. Generate reports by making selections and exporting data and/or images to Excel, PowerPoint, Word, HTML, etc. Provide additional front- end interactivity, for example dynamically modifying charts or selections, calling a web service etc. 6 Qlik Dev Group NL – October 29th 2015
  • 7. MACROUSE CASES (2/2) Cache warming Mass updates Dynamicupdate Developmentautomation Timed script that automatically makes selections on big server documents. Ensures that the results are already cached for the users. Perform an ad-hoc mass update of document, sheet or object properties across an application. Dynamically insert or update values into the QlikView data model. Automate common developer tasks, for example generation of ad-hoc report objects, or document layout and navigation. 7 Qlik Dev Group NL – October 29th 2015
  • 8. MACROUSE CASE CUSTOMSCRIPTFUNCTIONS Create additional functions that can be used in the QlikView script. Examples Regular Expressions*, Levenshtein Distance, SHA-1 hashing* Alternative: dump table to CSV during reload and process externally (R, Python, Perl) 8 Qlik Dev Group NL – October 29th 2015 * See: http://www.qlikfix.com/2010/10/18/regular-expressions-in-the-load-script/ for example ** See: http://www.qlikfix.com/2012/06/06/check-if-your-linkedin-password-was-leaked/ for example Good idea? Depends
  • 9. Requires some additional tweaking touse Set AllowMacroFunctionsInExpressions to 1 Found in Easter Egg menu: Help | About QlikView | Right-click Q MACROUSE CASE CUSTOMCHARTFUNCTIONS Use additional macro functions within expressions in the front-end. 9 Qlik Dev Group NL – October 29th 2015 Good idea? No, unless…
  • 10. MACROUSE CASE REPORTGENERATION Export QlikView data and objects into external reports, for example in PDF, PowerPoint, Excel, Word or HTML. Can be done from within the application, butalso externally Qlik Dev Group NL – October 29th 2015 Good idea? Depends Example included in presentation files 10
  • 11. Macro’s are run bythe user using button/text object, or by using triggers. Many macro’s do not work in AJAX client, OnPostReload trigger doesn’t work on server. Can have stability issues or just plain confuse the user. MACROUSE CASE FRONT-ENDINTERACTIVITY Add additional ‘pyrotechnics’ to the QlikView front-end, for example changing chart properties at run time, adding/modifying expressions, etc. 11 Qlik Dev Group NL – October 29th 2015 Good idea? No! Example included in presentation files
  • 12. MACROUSE CASE CACHE WARMING Open a (large) document on the QlikView Server and ensure that common user selections have been made (and cached), before the ‘real’ users log in. Cache warming improves ‘perceived’ performance It’s a good idea to first try to improve the actual performance of an app before using cache warming. Alternatives: QV Scalability Tools* or Selenium Qlik Dev Group NL – October 29th 2015 Good idea? Sort of, better alternatives out there *QV Scalability Tools can be downloaded here: https://community.qlik.com/docs/DOC-6658 12
  • 13. When other solutions do not work, macro’s can be useful todomass updates Alternatives: Search & Replace expressions, Search & Replace across Prj- files, Format Painter, applying themes, etc. MACROUSE CASE MASS UPDATES Perform an ad-hoc mass update of documents, sheets or objects. Across an application, or across multiple applications. 13 Qlik Dev Group NL – October 29th 2015 Good idea? Yes, but be careful, better safe than sorry Example included in presentation files
  • 14. MACROUSE CASE DYNAMICUPDATES Dynamically insert or update rows in the QlikView data model. Trickle load datainto the data model Partial alternative: Partial Reload Qlik Dev Group NL – October 29th 2015 Good idea? No, just don’t use Dynamic Updates Example included in presentation files 14
  • 15. A lazy efficient developer is a good developer! Minimize time on non-value added activities, so you can spend more time on the things that really matter. MACROUSE CASE DEVELOPMENTAUTOMATION Automate common developer/designer tasks. For example exporting and importing variables, creating ad-hoc analysis objects, creating navigation and layout object. 15 Qlik Dev Group NL – October 29th 2015 Good idea? Yes, a very good idea! See http://www.qlikfix.com/2013/09/06/importing-and-exporting-variables/ for an example
  • 16. DEVELOPING MACRO’S Reference materials anddebugging Qlik Dev Group NL – October 29th 2015 16
  • 17. Qlik Dev Group NL – October 29th 2015 17 DEFAULT DEVELOPMENT ENVIRONMENT Built-in Module Editor • Found under Tools | Edit Module • No-frills • Kind of a pain to work with Debugging? Virtually non-existent, besides writing values to a message box.
  • 18. Qlik Dev Group NL – October 29th 2015 18 ALTERNATIVEDEVELOPMENT ENVIRONMENT VbsEdit • Stand-alone VBScript IDE • IntelliSense • Object Browser • Compile to EXE Debugging? Plenty! Add breakpoints, inspect values and objects at runtime, etc. What’s the catch? Not free, costs 49 Euro. Download from http://www.vbsedit.com/
  • 19. Qlik Dev Group NL – October 29th 2015 19 REFERENCEMATERIALS API Guide • Provided by Qlik • Lists simplified object model • Describes methods and properties • Nice collection of sample macro’s Check out other people’s stuff • QlikCommunity • Blogs Download from https://community.qlik.com/docs/DOC-2640
  • 20. Qlik Dev Group NL – October 29th 2015 20 DEVELOPMENT TIPS Use Option Explicit Forces the explicit declaration of all variables. Use descriptive variable names So not xyz but wbExport or chProps. Comment your code Needs no further explanation, just do it already. Don’t misuse On Error Resume Next Only use for error handling, not to mask crappy code Write reusable subroutines Compartmentalize functionality so that you can reuse it across applications, i.e. not “one big subroutine”.
  • 21. Qlik Dev Group NL – October 29th 2015 21 SYSTEMACCESS When dealing with macro’s that access the system (i.e. stuff outside of QlikView), don’t forget to enable System Access in the Module Editor. Requested Module Security shows access level requested by the developer. Current Local Security shows the access level granted by the user.
  • 22. Qlik Dev Group NL – October 29th 2015 22 INCLUDING MACRO’S The macro editor doesn’t have the $(include) option that we can use in regular QlikView script, but we can simulate it, with a macro. Uses the ExecuteGlobal command. Allows you to store your macro’s in external VBS files and include them into your applications. Useful for version control. Read more at http://www.qlikblog.at/509/simulating-include-command-qlikview-macros/
  • 23. MACRO MYTHS Busted? Ornot? Qlik Dev Group NL – October 29th 2015 23
  • 24. Qlik Dev Group NL – October 29th 2015 24 MACROMYTHS Macro’s are single-threaded SOMEWHAT Macro code is executed sequentially (i.e. “single-threaded”) but each statement can be multi-threaded.
  • 25. Qlik Dev Group NL – October 29th 2015 25 MACROMYTHS Macro’s clear the cache FALSE Any selection that is made by a macro is cached in the same way as a regular selection made in the UI.
  • 26. Qlik Dev Group NL – October 29th 2015 26 MACROMYTHS Macro’s clear the undo/redo stack TRUE Changing document, sheet or object properties in a macro will clear the undo/redo stack.
  • 27. COOL MACRO’S Sowhat’s being done with macro’s? Qlik Dev Group NL – October 29th 2015 27
  • 28. Qlik Dev Group NL – October 29th 2015 28 DOCUMENTANALYZER • Analyzes the structure of a QVW • Focuses on which fields are used and where • Can be used to tune performance of QlikView applications or investigate impact of data changes • Made by Rob Wunderlich Download from http://qlikviewcookbook.com/tools/
  • 29. Qlik Dev Group NL – October 29th 2015 29 COPYGROUPS UTILITY • Copy cyclic and drill-down groups from one QlikView application to another. • Yes, it’s Rob again Download from http://qlikviewcookbook.com/tools/
  • 30. Qlik Dev Group NL – October 29th 2015 30 QLIKVIEW MACROCOLLECTION Collection of macro’s by Lucian Cotea Examples for: • Exporting JPEG’s • Exporting to Excel • Sending emails • Setting Autozoom • Creating variables • and lots of other stuff https://luciancotea.wordpress.com/2013/07/18/qlikview-macros-useful-collection/
  • 31. Qlik Dev Group NL – October 29th 2015 31 TURBOQLIK Internal Bitmetric tool, used for: • Template / layout generation • Color management • Variable management • Ad-hoc report object generation • Object library • And whatever makes our life easier
  • 33. CONTACTINFO Telephone, Address, Email,Social Media, etc. Qlik Dev Group NL – October 29th 2015 33
  • 34. SOCIAL MEDIA Twitter Google+ LinkedIn https://twitter.com/meneerharmsen https://plus.google.com/+BarryHarmsen http://www.linkedin.com/in/barryharmsen Qlik Dev Group NL – October 29th 2015 34
  • 35. CONTACT INFO Bitmetric B.V. Planetenweg 5 2132 HN, Hoofddorp TheNetherlands barry@bitmetric.nl +31 (0)23 2302 062 +31 (0)62 4581 706 35 Qlik Dev Group NL – October 29th 2015