This example shows the different songs that have been removed, being able to filter by date, number of bytes, duration of this and by money billed per song.
Parameterization of the box:
- Graph type selector Crossfilter.
- SQL statement to execute, in this case:
<select> <columns> invoice.invoicedate <alias name='the_date'/>, "M€" <alias name='unit1'/>, "bytes" <alias name='unit2'/>, "ms" <alias name='unit3'/>, "date" <alias name="unit4"/>, track.name <alias name="track"/>, artist.name <alias name="artist"/>, album.title <alias name='album'/>, invoice.total <alias name='value1'/>, track.bytes <alias name='value2'/>, track.milliseconds <alias name='value3'/> </columns> <from table='track'> <join table='invoiceline'> <on>track.trackid = invoiceline.trackid</on> <join table='invoice'> <on>invoiceline.invoiceid = invoice.invoiceid</on> </join> </join> <join table='album'> <on>album.albumid=track.albumid</on> <join table='artist'> <on>artist.artistid = album.artistid</on> </join> </join> </from> </select>
* Starting from the table of tracks and grouping by gender, artist and billing of each song, a series of histograms are created where you can filter to see the data that meet the conditions. In the table below you can see the results that comply with all the filters.
- the_date: Timestamp with the date
- unit1: Units corresponding to the value 1.
- unit2: Units corresponding to the value 2.
- unit3: Units corresponding to the value 3.
- unit4: Units corresponding to temporary dates.
- Extra values: Extra values with the desired name. They will only be displayed in the table. (in our example: track, artist and album).
- value1: it will be used to filter the information.
- value2: it will be used to filter the information.
- value3: it will be used to filter the information.
Each entry contains information about an element. these can then be filtered according to the dates and the different values. The filters are required, the code expects the three values. if you only want to filter with 2 values, the third one will be repeated with the information of one of the other two.
In this type of graph the user can interact to create or modify the filters.
- (1) Create/Edit filters: By clicking at one of the histograms, drag an area that will represent a filter. Samples that are within the selected area are considered valid. An already created area can be modified with click & drag on her.
- (2) Delete filters: When creating a filter, a small button of " reset " appears above the histogram. When you click on it, the created filter is deleted.