Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I am trying to add an image as a calculated dimension.
This is my expression condition:
=If( Aggr( Concat( {$<[Date Type]={'Start Dates'}, [Declaration Status]={'Next'}
,Year=>} DISTINCT Rating),[MY Program])='G','qmem://Image Name/G',
If( Aggr( Concat( {$<[Date Type]={'Start Dates'}, [Declaration Status]={'Next'}
,Year=>} DISTINCT Rating),[MY Program])='Y,'qmem://Image Name/Y',
If( Aggr( Concat( {$<[Date Type]={'Start Dates'}, [Declaration Status]={'Next'}
,Year=>} DISTINCT Rating),[MY Program])='R','qmem://Image Name/R')))
I followed the thread here:
https://community.qlik.com/t5/QlikView-App-Development/Image-as-dimension/td-p/328511/page/2
and I was able to get the expression together after I Bundle Loaded my images. However, when I click apply I do not see my desired image. The expression is correct because the result is correct that but the image itself does not load. I see that it is working to select the right image but it does not load and just shows the one to be selected:
If the result was to be 'G', it shows qmem://Image Name/G and not the image that represents 'G'.
Any ideas of where I might be going wrong?
Thanks in advance
No worries Brett, and I appreciate all the help.
I did finally get it to work.
There was something going on with the initial Pivot Chart I created that was causing the error.
Firstly, I had to make sure that the bundle load was indeed loaded into the application. The only way I got it to load was by ensuring that the Bundle Load was on a separate tab and that tab was at the very end of the script. Why? I do not know, but once I did that then was I able to see the images in the image section of the expression builder.
Secondly, because I am doing this for dimensions please make sure you click advanced and change to show as image.
Thirdly, Font Size. Yes, font size is crucial. My default font was 10. If I increase it to 11, the images disappear. Why? I do not know either. But that's what works for me.
Padda Boom padda bam.
Thank you to all for helping me trying to get this thing working. Till the next time 🙂
One more thing...
I had to place the dimension before any other dimensions that have a conditional variable. Why? I do not know, but I got it to work that way.
Thanks.
Hey Zoe, I was able to find a prior post with the answer! 🙂 You need an '=' in front of the qmem to get it to evaluate things! 🙂
'=qmem://Image Name/G'
Hopefully that will do the trick, here is the link to the other post too:
https://community.qlik.com/t5/QlikView-App-Development/qmem-not-displaying/td-p/1363650/page/2
Cheers,
Brett
Thanks Brett.
I am getting an error message when I add the '=' sign before the expression like:
=If( Aggr( Concat( {$<[Date Type]={'Start Dates'}, [Declaration Status]={'Next'},Year=>} DISTINCT Rating),[MY Program])='G',='qmem://Image Name/G.JPEG',...
and when I put the '=' after the ' the image does not load.
=If( Aggr( Concat( {$<[Date Type]={'Start Dates'}, [Declaration Status]={'Next'},Year=>} DISTINCT Rating),[MY Program])='G','=qmem://Image Name/G.JPEG',...
But I do see that it has chosen the right one to be shown. Is the issue that I am using JPEG's vs PNG?
I have double checked that Advanced>Representation is set to Image too.
My bad on the placement of the quote, I rechecked the other post, and you are correct, the = should be outside the quotes. As far as jpeg v png, that is good question to which I am not sure I have an answer off the top of my head. The png may make sense though as those are going to be the most compressed anyway, so I am wondering if the load of your images is automatically converting them and that is why you are now stuck, so try .png instead of .jpeg and see if it works. Hopefully that will do the trick, the Help is not very clear unfortunately! 🙂
Cheers,
Brett
Hi Brett,
Thanks for the info.
I made the changes as stated and I am still not able to see the image.
The interesting thing is that the result I am getting is the correct one, but just not the image. So the expression is working but the image is not able to load. I have changed the representation to Image and also info as image and still no image loads.
I am not sure what else I need to do in this instance?
Hi Brett,
Just checking in to see if you would have any other ideas I could try out. I did try to follow the Technical brief but for some reason I cant see my list of images available under the images tab in the expression viewer.
Thanks.
Hey Zoe, yeah, I would have to think something is wrong in the Bundle Load at this point is all that really makes much sense. Have you tried to reference one of the images via a Text Box object just to be sure it will show up that way? That should be a good test, as if that does not work either, I would think something is going wrong in the load at that point. As a temporary test, you could put those images on a web server etc. and use an http link to see if that will work.... Just need to do some further troubleshooting to try to narrow things down further. The other option would be to submit a support case on this one, as if you can attach the QVW etc., we should be able to have a look at things to see if we can figure anything out that way. Sorry I do not have anything better for you. I am going to be out for the next week too, just FYI, so is not that I will be ignoring you if I do not reply! 🙂
Cheers,
Brett
No worries Brett, and I appreciate all the help.
I did finally get it to work.
There was something going on with the initial Pivot Chart I created that was causing the error.
Firstly, I had to make sure that the bundle load was indeed loaded into the application. The only way I got it to load was by ensuring that the Bundle Load was on a separate tab and that tab was at the very end of the script. Why? I do not know, but once I did that then was I able to see the images in the image section of the expression builder.
Secondly, because I am doing this for dimensions please make sure you click advanced and change to show as image.
Thirdly, Font Size. Yes, font size is crucial. My default font was 10. If I increase it to 11, the images disappear. Why? I do not know either. But that's what works for me.
Padda Boom padda bam.
Thank you to all for helping me trying to get this thing working. Till the next time 🙂
Awesome write-up Zoe, thanks for all the details on what you had to do, that is most likely going to be very helpful to others, and unfortunately I have no input on some of the quirks you ran into either, very strange in my book too. If you do want us to look into those, feel free to open a Support Case, as given you have all the detail now, we should be able to see if we can replicate those things and get them submitted to R&D in that case. I would do it from here, but at the moment, without the support case, things do not get enough weight in the defect system to get much attention unfortunately. There is project to get that looked into, but at the moment this is the case, but I will leave things up to you, no pressure either way. Thanks again for the detailed solution post!
Cheers,
Brett
One more thing...
I had to place the dimension before any other dimensions that have a conditional variable. Why? I do not know, but I got it to work that way.
Thanks.