Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expressions in a table

I'm trying to set up a few reports (lists) where the report should be described in an external source (in this example as inline)

Report:

LOAD * INLINE [

    Report, Line, Text, Expression

    1, 1, "Line 1 - A1", "sum(  { <Account='A1'> } Amount)"

    1, 2, "Line 2 - A2", "sum(  { <Account='A2'> } Amount)"

    1, 3, "Line 3 - A3", "sum(  { <Account='A3'> } Amount)"

    2, 1, "Line 1 - B1", "sum(  { <Account='B1'> } Amount)"

    2, 2, "Line 2 - B2", "sum(  { <Account='B2'> } Amount)"

    2, 3, "Line 3 - B3", "sum(  { <Account='B3'> } Amount)"

    2, 4, "Line 4 - B4", "sum(  { <Account='B4'> } Amount)"   

];

So, by selecting either report 1 or 2, It would use different expressions (set analysis) for the report.

Is that possible in any way?

Best regards

Steen

2 Replies
gandalfgray
Specialist II
Specialist II

Hi Steen

Yes I think it is possible, but you may have to add a variable (vExpression for instance), and add triggers on the field so this variable is set when you select one of the Expression values.

Then you can use $(vExpression) as the expression for the report.

/g

jonathandienst
Partner - Champion III
Partner - Champion III

Steen

This is simple if you have one line per report, but not so simple with two dimensions (report and line). You might get a simpler solution if your table was something like:

Report, Text1, Expression1, Text2, Expression2, ... Textn, Expressionn

Then, if you select a report, you can get the expression for each line using (say 3 for example)

$(=Expression3)

Tip: best if your report selection list box is set to "one and only one" selection.

You may be able to use your structure by selecting both report and line (either from list boxes or through set analysis) and using

$(=Expression)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein