jjmontesl / cubesviewer

Explore and visualize analytical datasets
http://www.cubesviewer.com
Other
441 stars 112 forks source link

Missing months in the bar chart when there's no data for them #104

Open 62mkv opened 5 years ago

62mkv commented 5 years ago

would not it be reasonable to expect, when we use Date dimension as Horizontal dimension for Bar charts, that "empty" months will not be hidden? they're not hidden from our life anyway. at least one would expect to make it configurable as a chart option.

Currently, when using 2.0.3-devel version of cubesviewer-server, I see those periods "gone" from the chart and no visible option to display them as gaps in the horizontal axis

jjmontesl commented 5 years ago

Yes. This has been bothering me too for too long too.

When using Cubes with an explicit date dimension table (as opposed of extracting year/month/day from a single DATETIME column), you should be able to tell cubes to do a right join using:

To join a date dimension table so that every date will be present in the output reports, regardless whether there are any facts or not for given date dimension member:

"joins" = [
    {
        "master": "fact_contracts.contract_date_id",
        "detail": "dim_date.id",
        "method": "detail"
     }
]

Read the documentation because it contains some extra information: https://cubes.readthedocs.io/en/latest/backends/sql.html

Now, I'll try to implement this at CubesViewer level too because I'm interested in supporting this even when no table joins are involved (like when using DATETIME columns) or for supporting CSV data directly in CubesViewer. But note that progress in CubesViewer is slow. I'm undergoing a heavy refactor and I have no target date for the next version.