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

How can I access a specific variable according to a dimension value?

Hello everybody,
I'm a qlikview newbye, so please forgive me if I don't use a correct terminology.
I'm trying to create an application where a user can set weekly coefficients (using sliders) to shape income forecast. In my application I have a simple line-chart with "week" as dimension and Sum(SellOut_qty) as expression.
What I can do is:
  • - create a variable for each week
  • - link each slider to a variable
  • - place a sequence of 52 if clauses in the expression to check which is the week and use the correct variable as coefficient

Obviously this looks very tricky to me.
Is there a way to get dynamically a variable according to dimension value. I'm thinking, in example, about using a dinamic string to get the variable (something like vaiables["myVariable"])
Thanks in advance for your help
1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi,

I have two ideas:

1) If I have a variable vDate1, and set it to a Date

=$(='vDate'&'1')

will call that variable value (e.g. in a text box) and prints out the correct date, i.e. you can use so called dollar sign expression to evaluate the string (giving a variable name, evaluating to the date).

2) You could maybe also make use of the input fields instead of variables, allowing you to change the values of the fields elements in the front end. You can use this field as forecast parameter input and just link it to your week field 1:1. Using week as dimension should give your the parameter for this week for free then.

Regards,

Stefan

View solution in original post

2 Replies
swuehl
MVP
MVP

Hi,

I have two ideas:

1) If I have a variable vDate1, and set it to a Date

=$(='vDate'&'1')

will call that variable value (e.g. in a text box) and prints out the correct date, i.e. you can use so called dollar sign expression to evaluate the string (giving a variable name, evaluating to the date).

2) You could maybe also make use of the input fields instead of variables, allowing you to change the values of the fields elements in the front end. You can use this field as forecast parameter input and just link it to your week field 1:1. Using week as dimension should give your the parameter for this week for free then.

Regards,

Stefan

Not applicable
Author

Hi Stefan, The "idea" 1 is exactly what I was looking for. Thanks!