• P
    psysak

    Something else on this topic guys, is there a way that I can preprocess some of the data before I dump it into an excel report? Here's the deal.

    I have two stream of data which I'm basically using excel and multiplying together. One stream of data is 15 min electrical demand and the other is hourly cost of this electricity. I was using mango to give me hourly sums of the 15 min data and dumping both that and the hourly price into the excel report, only to have excel multiply the two numbers, hour by hour, together. What I suspect is that I've run up against having too many of these calculations. TBH this is very unnecessary. Ideally I would just do a bunch of this processing on the mango. Keep in mind that I have 60+ streams of the hourly electrical data as there are 60+ clients.

    I could see doing something like creating points for the result of the multiplication so that the mango would multiply the numbers for me day to day but Im wondering if there is anything I can do on the fly before it goes into the report?

    posted in User help read more
  • P
    psysak

    Hey guys, we have been working on a fairly large excel report, right now the mango says it takes 3 mins to run, and what we've run into is that we can't download the completed report for some reason. When I click download the page just loads nothing, goes just white and that's it.

    The generation of this report also seems to be pinning the CPU on my VM and just locking everything up.

    Any ideas on what I could do to try and figure out just what it is that's taking so long? I mean it is quite some data I have to admit.

    posted in User help read more
  • P
    psysak

    @jared-wiltshire COOL!! I'll have a look at that module, thank you so much!

    posted in User help read more
  • P
    psysak

    Hey guys, I'll preface this by saying that this will be a totally internal application so as stupid as it sounds it should be fairly secure.
    Is it possible to accept a file upload via just a web page being served by Mango, process it on the server and then allow the new file to be downloaded again? I just need to write a quick little csv file cleanup utility for a colleague which would basically take in a csv, run a regex against it to select and replace a couple of things and then offer it back to him. He's doing something manually in excel right now and a simple little thing like that would save them a bunch of time.

    posted in User help read more
  • P
    psysak

    @jared-wiltshire said in Calculating values on the fly:

    As above the serial chart directive needs a point to plot its series, I added a dummy point with XID cost so that it looks in the values array for the property value_cost and plots it.

    Hey, thanks for the explanation, super helpful. One last bit of clarification if you don't mind. Is the

    {xid: 'cost'} 
    

    an implied search term for xid which contains "cost"? It's not clear to me from this example and I want to understand that part. From that

    {name: 'Cost', xid: 'cost', deviceName: 'Cost'} 
    

    It seems like you're assigning a name and deviceName to this dummy point but an xid already exists in the array so specifying xid: 'cost' is actually implying a search for it?

    posted in User help read more
  • P
    psysak

    @jared-wiltshire said in Calculating values on the fly:

    @psysak Here's an example, with points from a watch list. The key is defining a function that multiplies together to two values and then applying it each element in the array - values="values.forEach(multiply); values"
    I also pass a dummy point to the serial chart so it picks up the new value which is defined in the array and plots it.
    You will need to use a rollup for this to work.

    <ma-watch-list-get ng-model="designer.watchList" parameters="designer.parameters" on-points-change="designer.points = $points" id="b7bdf2f9-bf34-417b-af00-58410963e785" watch-list-xid="WL_9950dd8e-91a1-4cf3-8ab1-e6c2b74ccab0"></ma-watch-list-get>
    
    <ma-calc input="designer.points | filter:{name:'Real power'}:true | maFirst" output="power"></ma-calc>
    <ma-calc input="designer.points | filter:{name:'Power factor'}:true | maFirst" output="price"></ma-calc>
    <ma-fn expression="$input.value_cost = $input['value_' + power.xid] * $input['value_' + price.xid]" fn="multiply" arg-names="['$input']"></ma-fn>
    
    <div class="ma-designer-root" id="8ee80d8a-f0cc-4dd3-a8a4-34e96dbbbdb9" style="width: 1366px; height: 768px; position: relative;">
        <ma-watch-list-parameters id="2c9a323a-440f-4fc0-86c9-f07b6ab4f13b" ng-model="designer.parameters" watch-list="designer.watchList" style="position: absolute; width: 100%; left: 0px; top: 0px;"></ma-watch-list-parameters>
        <ma-point-values id="0be711f5-7aa2-4f1c-985d-f1009ccb7143" points="[power, price]" from="dateBar.from" to="dateBar.to" rollup="{{dateBar.rollupType}}" rollup-interval="{{dateBar.rollupIntervals + ' ' + dateBar.rollupIntervalPeriod}}" style="position: absolute; left: 0px; top: 700px;" values="values"></ma-point-values>
        <ma-serial-chart id="daeda3f3-3509-46c0-a63a-5877bbfb7946" style="position: absolute; width: 100%; height: 600px; left: 0px; top: 70px;" values="values.forEach(multiply); values" points="[power, price, {name: 'Cost', xid: 'cost', deviceName: 'Cost'}]" legend="true" export="true" series3-type="step"></ma-serial-chart>
    </div>
    

    Hey Jared, I've been trying to wrap my mind around the mechanisms involved in this, could you please confirm/explain a few things?

    This expression

    <ma-fn expression="$input.value_cost = $input['value_' + power.xid] * $input['value_' + price.xid]" fn="multiply" arg-names="['$input']"></ma-fn>
    

    From messing around with this I've figured out that this expression is basically appending a "value_cost" property and value to whatever the array of data passed to it was correct? So in this case ma-point-values returned an array consisting of timestamp and two sets of values, one for power and one for price.

    <ma-serial-chart id="daeda3f3-3509-46c0-a63a-5877bbfb7946" style="position: absolute; width: 100%; height: 600px; left: 0px; top: 70px;" values="values.forEach(multiply); values" points="[power, price, {name: 'Cost', xid: 'cost', deviceName: 'Cost'}]" legend="true" export="true" series3-type="step"></ma-serial-chart>
    

    So ma-serial-chart gets an array of values from ma-point-values, passes that back to the function and the function transforms that array from something like this

    [{timestamp: xxx, power: xxx, price: xxx}]
    

    to

    [{timestamp: xxx, power: xxx, price: xxx, value_cost: xxx}]
    

    Is that about correct?

    So then in ma-serial-chart what exactly is the relationship between "points" and "values"? Internally are they linked somehow? Cause "values" is the values array. Then for "points" do they have to be listed in the order that the values array has them in? You're passing [{timestamp: xxx, power: xxx, price: xxx, value_cost: xxx}] and you said that you added a dummy point so that it catches the new value. As I think about it it kind of makes sense but I just want to make sure I'm understanding this correctly. If the dummy point wasn't there would it just ignore the value_cost values? And what would be the minimum requirements for this dummy point? Name, xid and device name?

    posted in User help read more
  • P
    psysak

    I just had this issue pop up in page editor as well. However, I've also realized that everything works perfectly fine in FireFox so if I have any issues I just open that up.

    posted in User help read more
  • P
    psysak

    Hey guys, just FYI this still seems to happen from time to time even clearing cache and everything else doesn't solve the issue. Firefox is the answer

    posted in Mango feedback read more
  • P
    psysak

    Thanks for the replies. I was contemplating the csv option because the number of reports is starting to get a little loony on my end. The thing with the excel report is formatting, as trivial as it may sound I don't want my clients just downloading raw csv files. I need our logo, proper formatting with bolding, some equations to run etc.

    I think most of my checkboxes are checked so long as I can load a single excel template and just trigger that the 80 or so times that I need to. I'll poke at the problem based on the thread @phildunlap posted.

    If I were to consider the csv way, are you guys aware of anything Angular, and maybe not so much the mango itself, could do?

    posted in User help read more
  • P
    psysak

    Quick question, is there a way to limit date ranges a user can pick? I have a situation where I'd like to limit a user to being able to pick only up to the end of last month and nothing this month.

    posted in User help read more