Git Product home page Git Product logo

qlik-snippets's People

Contributors

johnathonstonems avatar viperior avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qlik-snippets's Issues

Concise call method for RequireRecentData() subroutine

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.

Ranged slider

Users need a convenient and simple way to select a range of values within a field using a ranged slider input control.

Usage of attribute, Cardinality, deviates from standard definition

"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.

Min() Function

I need the complement of Max() for easy determination of the minimum of two values. Normally, this would require:

  • creating a table, taking the min() of some field
  • store this result in a variable using Peek()

Instead, I want to be able to simply write:
Call Min(vMin, vA, vB);
and have the value saved to vMin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.