These are chat archives for allegro/ralph

22nd
Aug 2017
Will Rouesnel
@wrouesnel
Aug 22 2017 03:40
What's the intended use of the serial number field on assets? It has a uniqueness constraint enforced, but across different hardware model lines serial numbers may not actually be unique.
Ruslan Vakilov
@supaflyster
Aug 22 2017 09:17

Hi!

Can somebody please help with the graph syntax?
Target is to have graph to see how many servers were bought on each year.
Axis X - years, Axis Y - amount. Date is stored in invoice_date field.
I've made a graph with following settings:

Model: data center asset

Aggregate type: Count

Chart type: Vertical Bar

Params:

{
    "filters": {},
    "labels": "invoice_date",
    "series": "invoice_date"
}

It is doing what I want, but dates in Axis X are full dates with YYYY-MM-DD and randomly mixed 2012-08-12, 2017-05-22, 2009-06-13, 2012-09-10 etc...

Question is: How to aggregate dates to Year only and sort them, so I have in Axis X:
2009 - x servers
2010 - y servers
2011 - z servers

Ralph docs (https://ralph-ng.readthedocs.io/en/latest/user/dashboards/) say I can use smth like this: "series": "invoice_date|year", but this gives an error "Series supports Only distinct (you put 'year')"

Django docs are not helping, as I am not familiar with it :(

Thank you!

Arkadiusz Adamski
@ar4s
Aug 22 2017 09:26
@supaflyster try this:
{
    "filters": {
        "invoice_date__isnull": false
    },
    "labels": "invoice_date|year",
    "series": "invoice_date",
    "sort": "year"
}
Ruslan Vakilov
@supaflyster
Aug 22 2017 09:28
amazing! Thanks a lot :)
Paweł
@ziompaul
Aug 22 2017 11:46
when importing CSV with VW machines, the machines with the same ID/baseobject_ptr as allready existing id database will be repleaced or it will be an error?
Mateusz Kurek
@mkurek
Aug 22 2017 11:50
@ziompaul should be replaced/updated