A CLI tool that leverages Qlik Core to report on basic metadata about a QVF.
Qlik Core leverages QVF files to store data models that you can interact with via the Qlik Associative Engine. These QVF files, like any file, are black boxes until you open them up and look inside. While developing solutions on top of Qlik Core, it can be difficult to understand what is going on with your QVF - what data is in there, what objects, etc. Writing scripts via enigma.js or RxQ to simply get a list of fields from a QVF that you are building on top of is cumbersome.
Eventually, I expect that Qlik, partners, and customers will build an ecosystem of nice dev tools for working with Core. In the meantime, I propose a CLI tool as a first step that can provide key metadata about QVFs in a quick and easy way.
There are no published solutions (that I'm aware of) today for easily working with Core across platforms. Alex Karlsson and Stefan Walther have indicated that they have some unpublished solutions that address these needs.
If you have access to Qlik Sense, it can be used to do some of these basic tasks. You can also leverage Rob Wunderlich's QS Document Analyzer, which gives a lot of this metadata. However, these solutions require both access and understanding of the Sense platform to make use of them. They may not be beneficial for a web or software developer who has no Sense background. Nor do they fit cleanly with a developer workflow that exists outside of a Qlik Sense context.
Most of the questions that I have while working with a QVF in Core are basically about its contents. Usually this is to either confirm that the QVF is set up as expected, or to get some insight on what I can leverage from it.
Specifically, I find myself asking questions like:
- What are the fields in this app?
- What are the tables and their relationships?
- What are the GenericObjects? Bookmarks? etc...
- What is the cardinality of a field?
- What are some sample values in a field? In a table?
- Do my calculations work? Does the data look as expected when I put some aggregations together?
Below is a rough approximation of what an API might look like for this tool.
From a terminal, navigate to a folder with some QVFs in it and run:
$ qli myApp.qvf
to start a Qlik Core session with that app. This will create an ongoing process where you can continue to enter commands that will be executed against the app. The following commands are executed from this process, after you've run the start command above to initiate a session.
fieldlist
objectlist
dimlist
etc. This could take a parameter for filtering the list. For example, you may want an object list of objects with a certain qType:
objectlist -t myType
tablesAndKeys
This would return a list of each table and the fields in that table. Additional metadata about the fields might be useful, like data types. Parameters could be added to control exactly what you get back. tablesAndKeys
may not be the best name, it maps back to the API but something like datamodel
might be more obvious.
cardinality "Field Name"
elements "Field Name"
properties "Field Name"
properties "object-id"
There probably needs to be a way to tell it what type you want to pull properties for (field vs generic object, etc). So an additional parameter might be needed
layout "object-id"
While I don't see this tool as an effective way to explore the associative data, a basic ability to get a layout on demand would be a useful debugging tool
selections
select "Field Name" "value to select"
preview -d "Dim1" "Dim2" -m "sum(Sales)"
This could return you a qMatrix with a subset of rows from a hypercube with those columns. This would be a quick way to validate that your data is loaded and associated properly
peek "tablename"
Returns a subset of rows from a table in your data model.
These are just a few ideas; For now I've basically kept out the concept of changing the QVF structure from the CLI. It could be useful, but I am not sure how you easily accomplish this in the API. For example, how would you write a generic object definition that you want to add to the QVF? What about a load script? Just copy and paste it in?
I'm looking feedback on this proposal to decide if and how an open source project should be started. Please leave comments with your thoughts.
Lets try and move the conversation here rather than Tweets :)
First of all i think that such tool is needed. At least i need it ;) I'm trying to build something on my spare time and was planning to have similar functionality.
As final output it should be CLI and GUI. CLI is faster to build so we can have something at hands quickly. The graphic element will be much better option especially when displaying relationships (for example)