Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
How to create arrays in qlikview using input box and store values in variable.
Vikas
As in many things in QlikView it depends on the context.
So if you want to assign the vArr[1] variable to v1 with the help of an Action you would write
=vArr[1]
directly in the Value entry box in the dialog box - no need for enclosing it in quotation marks.
You could use concat() to create a value-list like an array:
vArray:
= concat(distinct Field, ';')
and you could with substringcount() and subfield() read/access the content.
- Marcus
You can also create some pseudo-arrays like this:
The v3 shows the formula to access the value of vArr[2] dynamically by and index which is v2 in this case. This is not a very efficient storage structure and should be use with a limited number of values. Marcus advice will give a much more compact storage whereas my suggestion give something more similar to real arrays in other programming/scripting languages...
Suppose vArr[1] = 123 (123) value i want to hold in other variable how we can do the same.
Thanks
Vikas
What do you want to do with this array - what is the aim? Maybe there are other ways.
- Marcus
You could do it like this:
vOtherVar = '$(vArr[1])';
please check i am not able to get values in vOtherVar ???
As in many things in QlikView it depends on the context.
So if you want to assign the vArr[1] variable to v1 with the help of an Action you would write
=vArr[1]
directly in the Value entry box in the dialog box - no need for enclosing it in quotation marks.
As always QlikView is case-sensitive when it comes to Field-names and Variable-names.
The expression in the second text box could be simply:
=vARR[1]
without any quotation marks or $-sign expansion. See the attached fixed QVW....
I discovered something more in your QVW so I updated the application and have attached with the modification.