Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
how to find in an expression the fields/dimensions etc ... used?
For example if I have the following expression
If(my_var = 0, my_field_1, my_field_2)
I want to know that this expression contains one variable (my_var) and two fields (my_field_1, my_field_2).
Is it possible to do this with qlick sense engine api (without necessarily using regexp) ?
You can use the GetFieldsFromExpression method to get the field names from an expression. I am not aware of a way to get the variable names, however if I was doing something like this I would use the CreateSessionObject with the following parameters:
{
qInfo: {
qType: 'VariableList',
},
qVariableListDef: {
qType: 'variable',
qShowReserved: false,
qShowConfig: false,
},
}
and then use GetLayout on the resulting session object to get a list of all the variables in your app which could then be used with some sort of regex function to figure out which variables are being used in the expression.