3 Replies Latest reply: Dec 8, 2016 12:56 PM by Joey Lutes RSS

    Fieldname String Concatenation

    Joey Lutes

      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!