viperior / qlik-snippets Goto Github PK
View Code? Open in Web Editor NEWQlik scripting techniques and useful subroutines
Qlik scripting techniques and useful subroutines
If you want to check the recency of data before using that data to create a mapping table, you have to first load it into a non-mapping table. Then, you have to call the data recency subroutine and drop the temp table.
Example code:
[Data Recency Check]:
Load
Min([Data Source Access Time]) AS [Data Source Access Time]
From [lib://Warehouse - Extracts/Foo.qvd] (qvd)
;
Let vIncludePath = 'lib://Qlik Utility Library/RequireRecentData.qvs';
$(Must_Include=$(vIncludePath));
Call RequireRecentData('Data Recency Check', 'Data Source Access Time', vDataRecencyThreshold, vAllowStaleData);
Drop Table [Data Recency Check];
Since these tables are usually named Data Recency Check and the metadata field containing the access timestamp is usually named Data Source Access Time, you should be able to invoke the policy by providing only the data source file path.
Desired call structure:
Let vSourceQVDPath = 'lib://Warehouse - Extracts/Foo.qvd';
Call RequireRecentDataFromQVD(vSourceQVDPath);
In this shorter-form call, the invoked subroutine will make use of environmental variables: vDataRecencyThreshold and vAllowStaleData. By default, the environment-wide configuration system controls the values of these variables. They can also be overwritten at the app-level. Finally, it would automatically use the table name, Data Recency Check, and assume the timestamp field name is Data Source Access Time.
The new subroutine, RequireRecentDataFromQVD(), should invoke RequireRecentData().
One last request: an optional 2nd parameter, an override value for the timestamp field name, to allow use of the concise call method when the timestamp field has been aliased.
Users need a convenient and simple way to select a range of values within a field using a ranged slider input control.
"In mathematics, the cardinality of a set is a measure of the 'number of elements of the set.'" - Cardinality - Wikipedia
I describe cardinality in the ProfileTableFieldValues() subroutine as a relative value. I express it as a percentage, where the numerator is the number of distinct elements in the set, and the denominator is the total, present (non-null) elements in the set.
This usage of the term "cardinality" deviates somewhat from its mathematical definition, and another descriptive label may be more appropriate.
I need the complement of Max() for easy determination of the minimum of two values. Normally, this would require:
Instead, I want to be able to simply write:
Call Min(vMin, vA, vB);
and have the value saved to vMin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.