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

Update Values with For Loop

Hi

I came across this question online in a 5 question demo QV Developer exam.

A customer has 30 target values that are used to evaluate the quality of an organization's
facilities. At least half the target values are changed monthly by the business users.
What is the most efficient way for the developer to store, access, and maintain the target values?


A. embed the target values into each expression in which they are required
B. save the target names and values in an external file, load them into a QlikView table, and use a
FOR loop to assign the values to variables
C. create a Variables tab in the load script and use 30 LET statements to assign the values to variables
D. manually create a variable for each value in Expression Overview and maintain them in Expression
Overview


Answer: B


My question is, why do you need a loop to update the table? Why not just a normal reload? I've never came across a situation where this was necessary. Can someone please explain this for me and I'd appreciate a small qvw example cause I really don't understand this logic right now

Thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Tumelo,

You need to do a loop because you have 30 variables, you cannot assing this values manually on load script, and store them.

You need to do a Loop to assign the values to variables on Script.

See this post: Variables (with SA) declaration from excel file

Regards!

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hi Tumelo,

You need to do a loop because you have 30 variables, you cannot assing this values manually on load script, and store them.

You need to do a Loop to assign the values to variables on Script.

See this post: Variables (with SA) declaration from excel file

Regards!

marcus_sommer

The loop has the purpose to assign each table-value to a variable. If this is really the most efficient way to handle such a case? I personal would also rather load the table itself and connect it with normal table-associations or maybe a concatenate with the datamodel - especially to keep a history of these data and not overwrite them each month. Therefore I would suggest to create a further answer E for this question.

- Marcus

Not applicable
Author

Hi Manuel

Thanks for the reply, You clarified this for me...I guess the question itself was a bit vague. I assumed these values are in a table format as apposed to valriables