4 Replies Latest reply: Mar 2, 2015 9:41 AM by David Trent RSS

    Creating simulations

      Charts have the Animate capability.  I'd like to step through a time/date dimension, but across all objects on a sheet not just for one chart on the sheet.  The use case is to show a time-lapse or simulation view enabling us to show current state as well as various statistics, comparative graphs, etc. simultaneously at that moment in the simulation.


      I tried using the Sleep and WaitForIdle macro functions attached to a start button, but none of the sheet objects' refresh until the macro completes -- I saw initial start state and end, not the intermediate states.  I can manually get the effect needed by taking a time / calendar widget and manually choosing successive increments; what I need is for these selections to be done in an automated fashion. (and just like if I'm doing it manually I'd love to be able to pause, rewind, change my viewing speed, etc.)


      An example would be wonderful -- couldn't find any.  My hopes were raised in the Monte Carlo simulation community entry, but after running the simulation in the load script it only displays the final result.  It doesn't, for example, show in time-lapse the cumulative affect of those individual simulations.


      I fully appreciate I could do more complex ETL calculations to capture statistics on queue lengths, the distribution of those lengths, etc. -- and those are important things on the list to do -- but not what I'm trying to accomplish currently.  Also, I'm not interested in using bubble charts or some other visualization to capture statically what happened over that time frame.


      This capability would be invaluable to any Industrial Engineer examining conveyor belts, queuing systems, and the like.  Can't imagine it hasn't been asked for yet!



        • Re: Creating simulations
          Rob Wunderlich

          Did you include an ActiveDocument.GetApplication.Refresh call in your macro?



            • Re: Creating simulations

              Thanks Rob.  Using the Refresh works (sort of).  (I'm executing this on a desktop version of Qlik v11 SR5)


              The display issue I have in the attached QVW is that not all increments are displayed.  Generally speaking I'm seeing only every other update -- though occasionally I can see each.  For example, the current QVW performs increments in half-steps but the last time I ran the macro I observed: 1, 2, 3, 3.5, 4, 5, 6, 7, 8, 8.5, 9, 9.5, 10 instead of the expected 1, 1.5, 2, 2.5, 3, 3.5, ... 10.


              The confusing thing is that the increment skips I observe are somewhat independent of how long I have my Sleep delay set for.  When I set it to 25, 200, or 1000 I get (almost) as many skips.  Its as if Sleep interferes with background processes, that some more graceful pause is needed.


              I can workaround the issue currently with an increment interval several times smaller than my true step in the current PoC and hope that more complex data / visualizations don't extend the phenomenon.


              If you could sanity check the macro I'd appreciate it.  Thanks again!