Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
suzel404
Creator
Creator

InputBox without using InputField Function.

Hi all,

I want to create several steps to analyse the rent.

When I input the priceUnit automatically the all steps are calculated.

UnitPrice = 2.50 € and Step = 1.00 €

The 20 Inputboxes are calculated : 2.50€ - 3.50 € - etc.

I have a solution : create 20 variables. But Is ti possible to create a counter which increment all InputBox.

I don't want to use InputField beacause there are some trouble with the memory (out of memory).

I am in QV 11.20 SR5.

Someone would have a best suggestion ?

Thank you for your help.

1 Solution

Accepted Solutions
Not applicable

So,

if you change this part of script:

for i=1 to 10

let v_$(i) = i;

NEXT;

into:

for i=1 to 10

let v_$(i) = 0;

NEXT;

you will have have 10 variables with 0 value

View solution in original post

7 Replies
Not applicable

Joshua,

look on this example.

Select i, then input value into "Price" field, select another i, etc.

When you select i, there is i'th value presnenet in Price inputbox.

If you change Price, i'th value will be updated.

When you reload all ten provided values are setting againt to 1,2,3 ....

Let me know if it is good direction.

Regards

Darek

suzel404
Creator
Creator
Author

Hi Dariusz,

What a NICE direction!! Very interesting approach.

I've modified the script a little but I don't know if it is exact.

First is it possible to init variable to 0 or ' ' (nothing value) instead of 1,2,3,...

Second is it possible to format inputbox Price variable to '# ##0,00 €' because when I format to EUR. It is not possible enter new values in inputbox.


I duplicate the script because I need the same approach for Price, Bonus, Start, Distance, End, Variance and maybe others parameters. Can I have a problem in performance with all these variables created or not ?

Once again, your suggestion is very better. Simulate InputField with variables. Very brain!!

Many thank, Dariusz.

Not applicable

Hi,

1. of course. Simple change in load script:

for i=1 to 10

let v_$i = 0;

NEXT;

2.

i found, that if you choose Number in Number Format Settings, but use Format Pattern: # ##0,00 €;-# ##0,00 €

it works.

3. i dont expect performance problems if you will have up to 1000 variables

Of course test it!!!!

suzel404
Creator
Creator
Author

Is there a way to init all variables to 0 or nothing value ?

I create a text object with Action

Variable i=0 and j=0 but it doesn't work.

I have to init variable one by one : v_1=0,v_2=0, right ?

Not applicable

Look:

for i=1 to 10

let v_$(i) = i;

NEXT;

//this for loop generates 10 variables named v_[number]. If you need more, change  for i=1 to 10

i:

load RowNo() as i AutoGenerate(10);

// this prepares selector

load RowNo() as j AutoGenerate(10);

// this i use only to present chart with all actuala variables. i think, you dont need in your solution

load concat('v_'&i,',',i) as expr_tmp

resident i group by 1;

let v_pr_expr='pick(j,'&FieldValue('expr_tmp',1)&')';

//this i use also for presentation in chart. you may use this concept to generate you own expression with variables

Not applicable

So,

if you change this part of script:

for i=1 to 10

let v_$(i) = i;

NEXT;

into:

for i=1 to 10

let v_$(i) = 0;

NEXT;

you will have have 10 variables with 0 value

suzel404
Creator
Creator
Author

Thank for your help Dariusk. Very interesting Trick.