qStringExpression and qValueExpression

For simpler, one-off calculations where you just want to leverage the power of the Qlik Sense engine, qStringExpression and qValueExpression are the little sisters of qHyperCube and qListObject. They work using the same concept as the rest but on a simpler level: all you need to do is define a Qlik expression, and the engine will return to you its result in a promise:

var app = qlik.currApp(this);
app.createGenericObject({
user: {
qStringExpression:"=OSUser()"
},
version: {
qStringExpression:"=EngineVersion()"
},
fields: {
qValueExpression:"=Count (DISTINCT $Field)"
}
}, function ( reply ) {
var str = "Version:" + reply.version +
str+= " Number of Fields:"+reply.fields;
if(reply.user) {
str += " User:" + reply.user;
}
console.log(str)
}

Using those object definitions is very handy in conjunction with other objects, such as a qHyperCube.

The = sign in the string expression is not mandatory. Even if the = sign is not given, the expression is evaluated.

A string expression is not evaluated if the expression is surrounded by pure quotes.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.42.134