7 Replies Latest reply: Jun 21, 2017 10:34 AM by Andrey Khoronenko RSS

    What if analysis changing dates into a rangesum

    Nicolò Cogno

      Hi everybody,

       

      I've got a table that contains Engines that will be built in a certain date and it shows the Engine code, the quantity that will be produced and the date of production. I also have some orders that indicates when the parts that the engines are made of will arrive at the storage and so, for example:

       

      Order 1 will bring pieces A, B, C on the  20th of June and on the 21st of June the company will build the engine 1 with the pieces A, B and C.

       

      Imagine I've got lots of orders and lots of engines produced and I'm computing the cumulative sum into the script so that I always can have an idea about which pieces there will be in the storage on a certain date.

       

      Now, everything works, but I'd like to give the users the possibility to change the date on which one engine will be produced.

       

      To so I'm using 3 variables and I say, if variable 1 = old production date and variable 2 = engine that we want to produce on a different date, then show variable 3 as the new date, otherwise show me the old date.That is fine and I can also compute the cumulative sum on the front end using a rangesum, but when I try to compute it with the new date (and so aggregating by the pieces that the engine is made of and the the new date that is inside variable 3) I get a wrong result. I saw that the problem is given by the new date (obviously) because Qlik doesn't aggregate by the variable.

       

      What would you suggest me to do? Does anybody have other ideas, like creating "variable fields"? Maybe my approach is completely wrong!

       

      Thanks a lot for your help,

       

      best regards

       

      Nicolò Cogno