Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
;
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.
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
];
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
;
Hello petter-sI've suceded with the ImageID! thank you very much.
One Last question. How do I use the Representation LINK that you've mentioned before?