Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
joey_lutes
Partner - Creator
Partner - Creator

Fieldname String Concatenation

I hope this one's simple . . .

Using a consistent naming convention, I wish to dynamically concatenate a fieldname and have it be recognized by Qlik Sense as a dimension in an object.


In my Data Model, I have several tables similar to:

ThingX:

x.idx.namex.datex.type
12345name112-01-2016type1
23456name212-01-2016type2
34567name312-02-2016type2

Sample list of tablenames and fieldnames would be:

ThingXThingYThingZ
x.idy.idz.id
x.namey.namez.name
x.datey.datez.date
x.typey.typez.type

Also a variable:  vDim


Based on selection I wish to create  $vDim & '.id' (name, date, type, etc) in order to produce a straight table or filter box with the associated data - as if I had typed x.id as dimension, it would display 12345, 23456, 34567 accordingly

To support this, I've added a table:

Dim

     Load * [Inline

     ThingX, ThingY, ThingZ

     x, y, z];


Also a variable:  vDim

User selects a dimension ( $(vDim) - enabled in a Branch extension)

In a straight table and filter box  I've tried:

'$(vDim)'&'.id'

$(vDim)&.id

='$(vDim)'&'.id'    - produces ThingX.id literal (great for use in Labels/Titles)

=$(vDim)&'.id'     - this produces x.id in the table, but only 'x.id' literal - Qlik doesn't recognize that it's the field name.

I've realized I'll need the = sign it looks like, but it just doesn't seem to recognize that it's the name of the field and to treat it accordingly.

Thanks!

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Depending on your context, you probably need one of these two for x.id

[$(vDim).id]

$(=[$(vDim).id])

And similarly for the other fields.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
joey_lutes
Partner - Creator
Partner - Creator
Author

That's awesome - the first one worked . . . for like 3 seconds, then when I clicked on another dimension, it stopped and refuses to display again!!!  MOODY APP!!!

Ideas on that?

joey_lutes
Partner - Creator
Partner - Creator
Author

The problem was the Branch Extension

The first solution worked - thanks again!!