Considering I have the below data in the table Student
I wish to create variables in QlikView script with marks depending on the selected name.
eg: v_Tracy should have the value 66.
Variable name is taken as an example.
Can you please advice how to do this?
// Load the data
load * INLINE [
Name , Marks
Rob , 28
Bob , 32
Tracy , 66
Martin , 76
// Create the variables
For i =0 to NoOfRows('Data') -1
LET vName = peek('Name',$(i),'Data');
LET v_$(vName) = peek('Marks',$(i),'Data');
Thanks a lot!
Also, could you tell me how to fetch the value of Marks corresponding to Tracy, even if we did not know which Row number had Tracy's info?
To give you more clarity, I want to achieve something similar to the below pseudo sql query:
Retrieving data ...