Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mellerbeck
Creator II
Creator II

Best practices for using thresholds stored in a database in expressions

So let's say I have the fairly common scenario of wanting to dashboard certain measures compared to certain thresholds.

For a simple example, student attendance threshold is 90%, student grades and the threshold is 75% etc...

Usually I would just set a variable like vAttendaceThreshold, and then compare my set to the variable and change visuals to green or red.

But let's say all of the thresholds are stored in a table. Like

Name                    Threshold

Attendance            .90

Grades                  .75

I could use a where statement and then a peek to set the variable.

But I was wondering if anyone had ever dynamically created variables to simplify this? Basically loop through each field and create a variable based on the field name and then assign the threshold value to it?

Or, is there another method altogether? For example if I just loaded the table is there a function that I can pass 'Attendance' and get the threshold .90 returned? Something like fieldValue or fieldIndex or some such thing?

Thanks for any thoughts or suggestions on how you would do this! rwunderlich 

1 Solution

Accepted Solutions
maxgro
MVP
MVP

2 Replies
mellerbeck
Creator II
Creator II
Author

maxgro
MVP
MVP

you can adapt this, chane the source from excel to db

Storing variables outside of QlikView - The Qlik Fix! The Qlik Fix!