Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load Multiple Images to QlikView

Hello,

I was following this post Loading Images into QlikView that worked really good. Now I need to link multiple images to one ID.

For example: I have a customer profile picture and a cover picture, both of them associated to the same CustomerID.

I'm trying to do this with the Bundle LOAD but I'm not getting the expected results.

Thanks in advance.

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

It could be like this:

CustomerImages:

LOAD

    CustID,

    // IF the last CustID is equal to the current CustID THEN

    // add 1 to the ImageID

    // ELSE

    //     start at one because it is the first ImageID for this CustID

    If( Peek('CustID') = CustID, Peek('ImageID') + 1 , 1 ) AS ImageID,

    REF;

LOAD * INLINE [

  CustID, REF

  1, A

  1, B

  1, C

  2, E

  3, F

  3, G

  4,

  5,

  6, AA

  6, BB

  7, CC

  7,

  8, DD

];

The LOAD * INLINE [ ..... ];  you replace with:

SQL

    SELECT

           CustID,

          Ref

    FROM

          ImageTable

    ORDER BY

          CustID

;

View solution in original post

4 Replies
petter
Partner - Champion III
Partner - Champion III

BUNDLE LOAD is not for loading multiple images associated with for instance one customer. It is for getting the images loaded permanently into the data model - bundling them with regular data. Which is probably nothing you are looking for. This is normally just using up your precious RAM.

What you will have to do is to have multiple references for images connected to each customer. So you could either just number them or do that and have a special naming of them.

For instance like this:

Customers:

LOAD

     CustID,

     [Customer Name],

....

FROM

     .....;

CustomerImages:

LOAD * INLINE [

   CustID, ImageNo, ImageRef, ImageDesc

     1001, 1 , e:\imagestore\451234123.jpg, Profile

     1001, 2 , e:\imagestore\451234124.jpg, Logo

     1001, 3 , .....

     1049, 1, e:\imagestore\551234FFF.jpg, Profile

];

By using Representation LINK you will not load the images into memory but the end result in your application is that the images can be handled and shown in exactly the same way.

Anonymous
Not applicable
Author

Hello petter-s great answer!!! I have one question, how can I generate an autonumber for each customer photo (in the example the ImageNo), in case that one customer have more or less photos than others. And how I should use the representation LINK?


By the way, I'm reading the ImageRef from a table in a SQL Database.


CustomerImages:

LOAD * INLINE [

  CustID, ImageNo, ImageRef, ImageDesc

    1001, 1 , e:\imagestore\451234123.jpg, Profile

    1001, 2 , e:\imagestore\451234124.jpg, Logo

    1001, 3 , ...

    1049, 1, e:\imagestore\551234FFF.jpg, Profile

];

petter
Partner - Champion III
Partner - Champion III

It could be like this:

CustomerImages:

LOAD

    CustID,

    // IF the last CustID is equal to the current CustID THEN

    // add 1 to the ImageID

    // ELSE

    //     start at one because it is the first ImageID for this CustID

    If( Peek('CustID') = CustID, Peek('ImageID') + 1 , 1 ) AS ImageID,

    REF;

LOAD * INLINE [

  CustID, REF

  1, A

  1, B

  1, C

  2, E

  3, F

  3, G

  4,

  5,

  6, AA

  6, BB

  7, CC

  7,

  8, DD

];

The LOAD * INLINE [ ..... ];  you replace with:

SQL

    SELECT

           CustID,

          Ref

    FROM

          ImageTable

    ORDER BY

          CustID

;

Anonymous
Not applicable
Author

Hello petter-s‌I've suceded with the ImageID! thank you very much.

One Last question. How do I use the Representation LINK that you've mentioned before?