Graphics

 View Only
  • 1.  random row from xls file

    Posted 11-25-2020 21:05

    In the sequencer I have built a carousel, in which I call up an item, in which I show a random photo. I get this photo from an xls file. This XLS file is being connected trough datalinq.

    I filter the results via datalinq. I shuffle all the values ​​present and then show only the top row.

    my qyery in datalinq is

    SELECT top 1 [Sheet1$].[Id], [Sheet1$].[Titel], [Sheet1$].[Locatie], [Sheet1$].[Naam], [Sheet1$].[File]
    FROM [Sheet1$]
    where not([Sheet1$].[Id] is null)
    order by rnd([Sheet1$].[Id])

    And with this I get a single result.

    But this just doesn't work, because the refresh rate is not often. Every now and then I get a different result, but I can't figure out where to set the interval of refreshing. In my idea, every time expression "walks" in the carousel, past my scene, Xpression must retrieve the new values, via datalinq. Now that rarely happens.

    Also the "refresh time"  (which you can fill in at the datalinq connection tab, within datalinq) does not help my results either.



  • 2.  RE: random row from xls file

    Posted 12-27-2020 20:39

    Perhaps using scripting, (and a script scene director block if you know a specific time when you'd like to refresh), you can set a text object to be filled with a random number using Math.Rnd(), and have the Datalinq'd row be set to that text object? You might need to pass the total number of rows from the XLS file back to the scene (another datalinq'd text object)


    #XPression