<img src="https://track.adform.net/Serving/TrackPoint/?pm=268420" width="1" height="1" alt="">

QlikView - loading images into memory

4 min. læsetid
12. april 2013 Skrevet af: Henrik Matz Del med en ven     

Images in a QlikView application can be power full in many ways. Most of the time I see solutions were images are used as background in text-objects, but it’s also possible to load images into memory and connect the images to a your data – and then it starts to get funny!

When loading images into memory and connect them to for example an employee dimension table, you are able to show an image side by side with data of the employee. Even images uses a lot of screen space, it gives sense in many occasions, because images are faster to read and understand for the brain than text.

However, there are some considerations to think about, before you load tons of nice looking jpg-files of all you employees into your application.

First, be care full about the size of each image. The bigger size, the longer it takes to show the image. Keep each image to a thumbnail-size (100 kb or less). I have seen solutions, were more than 60.000 images of that size are loaded into memory and it had very small impact of the performance. However, 60.000 images of 100 kb each consumes 6 GB RAM, so you must ensure that you have enough RAM-storage.

Use the same background for each images. If you would like to upload images of employees, then try to avoid images were some pictures have a light background and others a dark.

If possible, use images in the same resolution.

Also, consider what to happen if an image of an employee is not available. In most cases I prefer, a dummy picture shown instead.

I have seen problems doing binary loads with images, so I recommend that you load your images in the final application tier and not in the QlikMart tier – if you have a QlikMart tier.

The easiest way to load images into your application is to ensure, that your files are named with the business key. So If your business key in you employee table is Initials, then make sure, that your files also are named with the Initials.

Then created a new attribute field in your Employee table containing the file-path to the image.

Your Employee table (Dim_Employee) could look like this (field names):

Where the field Employee_ImageFilePath contains the path to the image, for example:

Now all you need to do is loading the images into memory. To do that, you need the following simple script:

Employee_ ImageFilePath as info
RESIDENT Dim_Employee;

To test the image in the application you can use the following expression in a text-box:

And you have a nice looking image:

Good luck!