2

How to show URL icons in matrix grid?

Hello,

I have a requirement to show URL icons in matrix grid.

I am able to show URL's under question as URL after doing MAX of the URL value  but i need to show it as URL icons.

Please help me on this?

 

Regards,

Aaron Y

 

7 replies

null
    • Principal Customer Solutions Consultant
    • Mark_Oldfield.1
    • 3 wk ago
    • Reported - view

    Hi   in your data model definition (within model pro), you need to define the category of the attribute you wish to be shown as an image as 'Image URL', 

    note: It does not need to be a measure as its an attribute of the dimensional member

    This will provide the desired result within your data discovery when using this attribute,

     

    further information can be found here 

    thanks

     

    Mark.

      • Aaron_Yohannan
      • 3 wk ago
      • Reported - view

      Hi ,

      I have tested it but we need to show those under the execution columns showing URL icon as response where its difficult for the user to copy each and every URL.

       

      Please help us how to add them below the question in column and show them icons instead of long URLs

       

      Regards,

      Aaron Y

    • Brendan_Conway
    • 3 wk ago
    • Reported - view

    Hey Aaron,

    Are you essentially looking for a clickable url icon for each row of city? If so, you can make that field a "Url" category at the Data Model definition (see Mark's screenshot above and select "Url").

     

    Thanks,

    Brendan

    • NatalieAnne_Botha
    • 12 days ago
    • Reported - view

    Hi Mark and Brendon,

    I have looked at the model structure with Aaron and have put together the below example. We have pulled in the image as a URL dimension in the model as suggested above, the challenge is that the photo's are answers to questions and the client wishes to visualise it in a specific way.

    If you look at the below example - the table has a number of city's, along with questions/instructions to take a photo, we then have the URL as a photo.

    The bottom grid is how the client wishes to visualise it, with City down the left, Question along the top and the images in the cells. The only way we can see to do this is by pulling in the URL as a measure, but then the measure shows as the string and not the image.

    Is there any way to achieve the below?

    • Senior Director of Product
    • Ian_Macdonald
    • 11 days ago
    • Reported - view

    Hi  ,

    Pyramid does not currently support images in the data cells of Grids.

    However, we can post process the grid that contains URLs in Present using Dynamic Text.

    Here's my report, like yours with image URLs in the Grid:

    What we need to do is dynamically traverse the grid by reading across the rows and down the columns and taking each URL value and inserting its image into the text. We'll have to match the number of rows and columns dynamically, inserting a line break at the end of each row and stop processing at the end of the rows.

    In the Format folder of Dynamic Text functions, you'll see Image(), LineBreak() to take care of constructing the content and in the Logical folder a function called LoopVector. This automatically will perform nested loops we can use to traverse the rows and columns.

    Create a text box on the Present slide and insert Dynamic Text. Choose the grid with the URLs as the content to operate upon.

     

    LoopVector syntax is:

              LoopVector( <Text> , OPTIONAL <Start Integer> , <Start Integer> , <Loop Iterations> , <Loop Iterations> )

              Text is the text to be returned on each iteration of the loop.

               The first start integer is the value of index of the outer loop (index0) when starting iterations

               The second start integer is the value of index of the inner loop (index1) when starting iterations

               The first Loop Iterations is how many times to repeat the outer loop

               The second Loop Iterations is how many times to repeat the inner loop

    Add this to the formulation window:

    LoopVector(image(""+formattedData(index0,index1)+"",120,120)+"               " + If(index1=Numberofcolumns()-1,LineBreak(),""), 0,0, NumberOfRows(), NumberOfColumns())

    On Each iteration, the Image() function is called using the cell contents in the cell reference (index0,index1).

    The URL in he Image function must be enclosed in double quotes. to quote the quote, use paires of double quotes ,"".

    The 120, 120 is the height and width of the image.

    The "        " is to put some padding between each image.

    The If(index1=Numberofcolumns()-1,LineBreak(),"") tests the number of inner iterations (columns) and when it equals the numer of columns present, inserts a line break. The -1 is needed because index1 starts its count at zero, not 1.

    0,0 are start the outer and inner loop indexes at zero

    NumberOfRows(), NumberOfColumns() are the number of iterations of the outer and inner iterations respectively.

     

    Adding a couple of slicers to change the number of rows and columns, we can see our grid of images changes dynamically to match the grid:

    We need to add column and row headers. We could try to do that in one single Dynamic Text expression, but it does start to become rather unwieldy and difficult to understand and alignment of the text and images is awkward Easier is to create the text string required in a different text block then position the column and row headers on the slide

    As we are only concerned with looping across the columns or down the rows, we can use the simpler Loop() function to do this:

    Loop(label(0,0,index) + "           ",0, NumberofColumns())

    Loop(LineBreak()+LineBreak()+label(1,0,index)+LineBreak(),0, NumberofRows())

    Ending up with:

     

    Hope that helps!

    Ian

    • Principal Customer Solutions Consultant
    • Mark_Oldfield.1
    • 11 days ago
    • Reported - view

    What a great approach, I've placed a copy of this ingenious approach of using Dynamic text here on our Explore server environment so you can see this example first-hand.

    details on how to get a login for our Explore server can be found here 

    thanks

    Mark

    • Senior Director of Product
    • Ian_Macdonald
    • 11 days ago
    • Reported - view

    Hi again  ,

    If your data is very static, i.e. you only ever have 3 cities and 3 questions in those respective dimensions, i.e. you always have a 3x3 grid of URLs, then you could use matrix tables with each URL from the grid calling their respective images from each cell of the matrix table:

    etc.

    Giving:

    Hope that helps again!

    Ian

Content aside

  • Status Answered
  • 2 Likes
  • 11 days agoLast active
  • 7Replies
  • 61Views
  • 5 Following