Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Pico
Partner - Contributor III
Partner - Contributor III

Qualify and using variables to call qualified fields

Hi all, I'm having trouble using the qualified fields. i wuld like to use the modularity of the qualified fields with variables.

I have many tables, let's call them Tab 1, Tab 2, .. loaded with qualify statement.

Every table have various columns, some equal, some different. Let's call them A,B,C,D etc. In particular, A and B are common in all the tables.

So I have Table 1: A, B, C; and Table 2: A, B, D ...

Hence my fields are [Tab 1.A],[Tab 1.B],[Tab 1.C],[Tab 2.A],[Tab 2.B],[Tab 2.D] ...

I Cannot modify this structure, I already have keys, the structure is much more complicated than this so let's move on.

I have a field called FILTER, where the values are Tab 1, Tab 2, ...

I would like to count the number of entries of the column A in the different fields. So something like a KPI with just a "Count( [Tab X.A] )"

where Tab X is defined through the selection of the filed FILTER. Only one filed selected per time is allowed to the user.

At this point I defined a variable (aka vSelectedTab) that depends on the value selected by the user. I tried defining it in various ways:

GetFieldSelection(FILTER)&'.A' or '['&GetFieldSelection(FILTER)&'.A]'

as just strings, these variables works well, but once I try to use them as fields, for example with the KPI "count($(vSelectedTab))", they work no more.

How can I achieve this?

Thank you very much, have a great day

Pico

Labels (4)
1 Solution

Accepted Solutions
SerhanKaraer
Creator III
Creator III

Hello Pico,

If your vSelectedTab variable is GetFieldSelection(FILTER)&'.A' or '['&GetFieldSelection(FILTER)&'.A]' which is a string, you need a dollar sign expansion to make the string be a field.

count($(=$(vSelectedTab)))

or you can add equal sign into the variable in order to make the variable evaluated first like:

=GetFieldSelection(FILTER)&'.A' or ='['&GetFieldSelection(FILTER)&'.A]'

then you can use "count($(vSelectedTab))" without DSE.

I hope it solves.

View solution in original post

1 Reply
SerhanKaraer
Creator III
Creator III

Hello Pico,

If your vSelectedTab variable is GetFieldSelection(FILTER)&'.A' or '['&GetFieldSelection(FILTER)&'.A]' which is a string, you need a dollar sign expansion to make the string be a field.

count($(=$(vSelectedTab)))

or you can add equal sign into the variable in order to make the variable evaluated first like:

=GetFieldSelection(FILTER)&'.A' or ='['&GetFieldSelection(FILTER)&'.A]'

then you can use "count($(vSelectedTab))" without DSE.

I hope it solves.