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

Dynamic Field Name on Expression

Hi,

I have tables like that:

Table Values

[Value 01],     [Value 02],     [Value 03],     [Value 04]   ...... [Value 12]

102,                 200,                    588,               557          ......  231

302,                 400,                    238,               674          ......  211

504,                 200,                    454,               787          ......  344

168,                 540,                    358,               232          ......  432

149,                 341,                    543,               343          ......  342

239,                 540,                    356,               431          ......  342

Table Month

[Month_Number],     [Month_Name]

01,                             Jan

02,                             Feb

03,                             Mar

04,                             Ap

05,                             May

06,                             Jun

...

12,                             Dec

I want to do one table that have [Month_Number] with Dimension and the Expression put the sum of [Value xx] over it. Where xx is [Month_Number].

I'm trying to use the formula:

=sum($(='[Value ' & [Month_Number] &']'))

But it works just when I click over a Month_Number and I want that dispose all Month Independently of click.

How can I use the formula?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I have found a way to make this like below (example in attachment):

Values:

LOAD * INLINE [

    Value 01, Value 02, Value 03, Value 04,  Value 05, Value 06, Value 07,  Value 08, Value 09, Value 10, Value 11, Value 12

  102,        200,      588,      557,         231,    102,        200,      588,     102,        230,      581,    455

  302,        400,      238,      674,         211,    200,        454,      273,     332,        344,      123,    789

  504,        200,      454,      787,         344,    300,        454,      347,     345,        357,      125,    346

  168,        540,      358,      232,         432,    240,        334,      567,     124,        432,      111,    134

  149,        341,      543,      343,         342,    310,        424,      327,     356,        123,      124,    321

  239,        540,      356,      431,         342,    240,        154,      734,     976,        100,      125,    543

];

Month:

LOAD * INLINE [

Month_Name, Month_Number

Jan, 01

Feb, 02

Mar, 03

Apr, 04

May, 05

Jun, 06

Jul, 07

Aug, 08

Sep, 09

Oct, 10

Nov, 11

Dec, 12

];

Solution:

LOAD [Value 01] as Value,

  01 as Month_Number

RESIDENT Values;

LOAD [Value 02] as Value,

  02 as Month_Number

RESIDENT Values;

LOAD [Value 03] as Value,

  03 as Month_Number

RESIDENT Values;

LOAD [Value 04] as Value,

  04 as Month_Number

RESIDENT Values;

LOAD [Value 05] as Value,

  05 as Month_Number

RESIDENT Values;

LOAD [Value 06] as Value,

  06 as Month_Number

RESIDENT Values;

LOAD [Value 07] as Value,

  07 as Month_Number

RESIDENT Values;

LOAD [Value 08] as Value,

  08 as Month_Number

RESIDENT Values;

LOAD [Value 09] as Value,

  09 as Month_Number

RESIDENT Values;

LOAD [Value 10] as Value,

  10 as Month_Number

RESIDENT Values;

LOAD [Value 11] as Value,

  11 as Month_Number

RESIDENT Values;

LOAD [Value 12] as Value,

  12 as Month_Number

RESIDENT Values;

DROP Table Values;

View solution in original post

1 Reply
Anonymous
Not applicable
Author

I have found a way to make this like below (example in attachment):

Values:

LOAD * INLINE [

    Value 01, Value 02, Value 03, Value 04,  Value 05, Value 06, Value 07,  Value 08, Value 09, Value 10, Value 11, Value 12

  102,        200,      588,      557,         231,    102,        200,      588,     102,        230,      581,    455

  302,        400,      238,      674,         211,    200,        454,      273,     332,        344,      123,    789

  504,        200,      454,      787,         344,    300,        454,      347,     345,        357,      125,    346

  168,        540,      358,      232,         432,    240,        334,      567,     124,        432,      111,    134

  149,        341,      543,      343,         342,    310,        424,      327,     356,        123,      124,    321

  239,        540,      356,      431,         342,    240,        154,      734,     976,        100,      125,    543

];

Month:

LOAD * INLINE [

Month_Name, Month_Number

Jan, 01

Feb, 02

Mar, 03

Apr, 04

May, 05

Jun, 06

Jul, 07

Aug, 08

Sep, 09

Oct, 10

Nov, 11

Dec, 12

];

Solution:

LOAD [Value 01] as Value,

  01 as Month_Number

RESIDENT Values;

LOAD [Value 02] as Value,

  02 as Month_Number

RESIDENT Values;

LOAD [Value 03] as Value,

  03 as Month_Number

RESIDENT Values;

LOAD [Value 04] as Value,

  04 as Month_Number

RESIDENT Values;

LOAD [Value 05] as Value,

  05 as Month_Number

RESIDENT Values;

LOAD [Value 06] as Value,

  06 as Month_Number

RESIDENT Values;

LOAD [Value 07] as Value,

  07 as Month_Number

RESIDENT Values;

LOAD [Value 08] as Value,

  08 as Month_Number

RESIDENT Values;

LOAD [Value 09] as Value,

  09 as Month_Number

RESIDENT Values;

LOAD [Value 10] as Value,

  10 as Month_Number

RESIDENT Values;

LOAD [Value 11] as Value,

  11 as Month_Number

RESIDENT Values;

LOAD [Value 12] as Value,

  12 as Month_Number

RESIDENT Values;

DROP Table Values;