Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
See why BI users voted Qlik #1 in 11 categories. GET REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Variable Field Names in On-Demand App Generation (ODAG)

Hi all,

This question regards ODAG, but may simply be a problem with my dollar-sign expansions.

I want to be able to create an ODAG application with field names that are pulled in from an external table. This means that I don't want to hardcode field names in the data load editor.

The sample ODAG application "Flight Data", has a few fields that are being used for selections, including "Origin Code". Here is a snippet of code in the "Flight Data Detail" app that shows how the odag variable is used to access the field selections.

SET ORIGIN = ;

SET ORIGIN = $(odso_Origin Code);

SET ORIGIN_COLNAME='ORIGIN';

Trace ORIGIN: $(ORIGIN);

The Trace for this code looks like this (with a single selection on the Origin Code field):

ORIGIN: chr(39) & 'ABI' & chr(39)

What I'd like to do is use a variable field name, which I could set based upon a table, instead of hard-coding $(odso_Origin Code).

So I imagine something like this.

Let fieldName = 'Origin Code';

Set ODSO = odso_$(fieldName);

Let ODSO2 = '$(ODSO)';

SET ORIGIN2 = ;

SET ORIGIN2 = $($(ODSO2));

SET ORIGIN2_COLNAME='ORIGIN2';

Trace ORIGIN2: $(ORIGIN2);

This isn't working and I've tried, many different variations of Sets and Lets, Dollar-sign expansions, string expressions that are later evaluated, etc.

I'm not sure if the issue Qlik-General or ODAG specific.

Thanks.

1 Solution

Accepted Solutions
Highlighted
Luminary
Luminary

Hey Jonathan,

Unfortunately, this is not possible. When an On Demand app is created it first replaces the $(odso_FIELD) before running the app; it is hard coded in the script. By generating the variable with the above code, the Template app won't see any bindings, and therefore not replace the Binding variable, with the appropriate values.

Blog: WhereClause   Twitter: @treysmithdev

View solution in original post

2 Replies
Highlighted
Luminary
Luminary

Hey Jonathan,

Unfortunately, this is not possible. When an On Demand app is created it first replaces the $(odso_FIELD) before running the app; it is hard coded in the script. By generating the variable with the above code, the Template app won't see any bindings, and therefore not replace the Binding variable, with the appropriate values.

Blog: WhereClause   Twitter: @treysmithdev

View solution in original post

Highlighted
Creator III
Creator III

Yeah, I pretty much figured, but this is unfortunate.