Grafana transformation breaks x-axis ordering


I have built a report that works, then I calculated percentages using transformation: Divided each timeseries by the sum of all of the values. It worked for a while, but now I’m seeing this kind of unexpected behavior. For the transformation I mainly used add field from calculation and then filtered by the name.

I have checked that the data is correct in the original query - when i remove the transformations, but somehow after applying the first transformation, the x-axis gets distorted again.

Is there some way to order the data with the transformations or something else I’m missing?

Hi @mpaloni,

Can you provide us with more details? What does your data look like in the table visualization before you add transformations? What is your datasource, your query, your transformation, and your grafana version?

Hey, and thanks in advance for the help!

We are using Redshift as database and Grafana v7.3.1

I managed to get some time and now make it replicable with mock data:

Here’s the sql to create the data

drop table if exists SCHEMA_NAME.TABLE_NAME;
create table SCHEMA_NAME.TABLE_NAME as (
select to_date('2020-07-02','YYYY-MM-DD') "time", 'A' "type", 69 "lkm"

select to_date('2020-07-03','YYYY-MM-DD') "time", 'A' "type", 85 "lkm" union
select to_date('2020-07-04','YYYY-MM-DD') "time", 'A' "type", 88 "lkm" union
select to_date('2020-07-05','YYYY-MM-DD') "time", 'A' "type", 89 "lkm" union
select to_date('2020-07-06','YYYY-MM-DD') "time", 'A' "type", 75 "lkm" union
select to_date('2020-07-07','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2020-07-08','YYYY-MM-DD') "time", 'A' "type", 83 "lkm" union
select to_date('2020-07-09','YYYY-MM-DD') "time", 'A' "type", 99 "lkm" union
select to_date('2020-07-10','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2020-07-11','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2020-07-12','YYYY-MM-DD') "time", 'A' "type", 82 "lkm" union
select to_date('2020-07-13','YYYY-MM-DD') "time", 'A' "type", 76 "lkm" union
select to_date('2020-07-14','YYYY-MM-DD') "time", 'A' "type", 79 "lkm" union
select to_date('2020-07-15','YYYY-MM-DD') "time", 'A' "type", 88 "lkm" union
select to_date('2020-07-16','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-07-17','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2020-07-18','YYYY-MM-DD') "time", 'A' "type", 82 "lkm" union
select to_date('2020-07-19','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-07-20','YYYY-MM-DD') "time", 'A' "type", 72 "lkm" union
select to_date('2020-07-21','YYYY-MM-DD') "time", 'A' "type", 73 "lkm" union
select to_date('2020-07-22','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-07-23','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2020-07-24','YYYY-MM-DD') "time", 'A' "type", 94 "lkm" union
select to_date('2020-07-25','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2020-07-26','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2020-07-27','YYYY-MM-DD') "time", 'A' "type", 76 "lkm" union
select to_date('2020-07-28','YYYY-MM-DD') "time", 'A' "type", 86 "lkm" union
select to_date('2020-07-29','YYYY-MM-DD') "time", 'A' "type", 84 "lkm" union
select to_date('2020-07-30','YYYY-MM-DD') "time", 'A' "type", 94 "lkm" union
select to_date('2020-07-31','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2020-08-01','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2020-08-02','YYYY-MM-DD') "time", 'A' "type", 88 "lkm" union
select to_date('2020-08-03','YYYY-MM-DD') "time", 'A' "type", 73 "lkm" union
select to_date('2020-08-04','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-08-05','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2020-08-06','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2020-08-07','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2020-08-08','YYYY-MM-DD') "time", 'A' "type", 97 "lkm" union
select to_date('2020-08-09','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2020-08-10','YYYY-MM-DD') "time", 'A' "type", 74 "lkm" union
select to_date('2020-08-11','YYYY-MM-DD') "time", 'A' "type", 75 "lkm" union
select to_date('2020-08-12','YYYY-MM-DD') "time", 'A' "type", 89 "lkm" union
select to_date('2020-08-13','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2020-08-14','YYYY-MM-DD') "time", 'A' "type", 97 "lkm" union
select to_date('2020-08-15','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2020-08-16','YYYY-MM-DD') "time", 'A' "type", 89 "lkm" union
select to_date('2020-08-17','YYYY-MM-DD') "time", 'A' "type", 70 "lkm" union
select to_date('2020-08-18','YYYY-MM-DD') "time", 'A' "type", 85 "lkm" union
select to_date('2020-08-19','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-08-20','YYYY-MM-DD') "time", 'A' "type", 99 "lkm" union
select to_date('2020-08-21','YYYY-MM-DD') "time", 'A' "type", 95 "lkm" union
select to_date('2020-08-22','YYYY-MM-DD') "time", 'A' "type", 94 "lkm" union
select to_date('2020-08-23','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2020-08-24','YYYY-MM-DD') "time", 'A' "type", 76 "lkm" union
select to_date('2020-08-25','YYYY-MM-DD') "time", 'A' "type", 89 "lkm" union
select to_date('2020-08-26','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2020-08-27','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2020-08-28','YYYY-MM-DD') "time", 'A' "type", 119 "lkm" union
select to_date('2020-08-29','YYYY-MM-DD') "time", 'A' "type", 120 "lkm" union
select to_date('2020-08-30','YYYY-MM-DD') "time", 'A' "type", 94 "lkm" union
select to_date('2020-08-31','YYYY-MM-DD') "time", 'A' "type", 74 "lkm" union
select to_date('2020-09-01','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2020-09-02','YYYY-MM-DD') "time", 'A' "type", 84 "lkm" union
select to_date('2020-09-03','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2020-09-04','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2020-09-05','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2020-09-06','YYYY-MM-DD') "time", 'A' "type", 97 "lkm" union
select to_date('2020-09-07','YYYY-MM-DD') "time", 'A' "type", 83 "lkm" union
select to_date('2020-09-08','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-09-09','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2020-09-10','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2020-09-11','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2020-09-12','YYYY-MM-DD') "time", 'A' "type", 115 "lkm" union
select to_date('2020-09-13','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2020-09-14','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-09-15','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2020-09-16','YYYY-MM-DD') "time", 'A' "type", 95 "lkm" union
select to_date('2020-09-17','YYYY-MM-DD') "time", 'A' "type", 92 "lkm" union
select to_date('2020-09-18','YYYY-MM-DD') "time", 'A' "type", 118 "lkm" union
select to_date('2020-09-19','YYYY-MM-DD') "time", 'A' "type", 119 "lkm" union
select to_date('2020-09-20','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2020-09-21','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-09-22','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2020-09-23','YYYY-MM-DD') "time", 'A' "type", 97 "lkm" union
select to_date('2020-09-24','YYYY-MM-DD') "time", 'A' "type", 97 "lkm" union
select to_date('2020-09-25','YYYY-MM-DD') "time", 'A' "type", 139 "lkm" union
select to_date('2020-09-26','YYYY-MM-DD') "time", 'A' "type", 139 "lkm" union
select to_date('2020-09-27','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2020-09-28','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2020-09-29','YYYY-MM-DD') "time", 'A' "type", 86 "lkm" union
select to_date('2020-09-30','YYYY-MM-DD') "time", 'A' "type", 97 "lkm" union
select to_date('2020-10-01','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2020-10-02','YYYY-MM-DD') "time", 'A' "type", 141 "lkm" union
select to_date('2020-10-03','YYYY-MM-DD') "time", 'A' "type", 137 "lkm" union
select to_date('2020-10-04','YYYY-MM-DD') "time", 'A' "type", 94 "lkm" union
select to_date('2020-10-05','YYYY-MM-DD') "time", 'A' "type", 83 "lkm" union
select to_date('2020-10-06','YYYY-MM-DD') "time", 'A' "type", 96 "lkm" union
select to_date('2020-10-07','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2020-10-08','YYYY-MM-DD') "time", 'A' "type", 118 "lkm" union
select to_date('2020-10-09','YYYY-MM-DD') "time", 'A' "type", 155 "lkm" union
select to_date('2020-10-10','YYYY-MM-DD') "time", 'A' "type", 157 "lkm" union
select to_date('2020-10-11','YYYY-MM-DD') "time", 'A' "type", 111 "lkm" union
select to_date('2020-10-12','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2020-10-13','YYYY-MM-DD') "time", 'A' "type", 97 "lkm" union
select to_date('2020-10-14','YYYY-MM-DD') "time", 'A' "type", 97 "lkm" union
select to_date('2020-10-15','YYYY-MM-DD') "time", 'A' "type", 138 "lkm" union
select to_date('2020-10-16','YYYY-MM-DD') "time", 'A' "type", 187 "lkm" union
select to_date('2020-10-17','YYYY-MM-DD') "time", 'A' "type", 167 "lkm" union
select to_date('2020-10-18','YYYY-MM-DD') "time", 'A' "type", 119 "lkm" union
select to_date('2020-10-19','YYYY-MM-DD') "time", 'A' "type", 84 "lkm" union
select to_date('2020-10-20','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2020-10-21','YYYY-MM-DD') "time", 'A' "type", 94 "lkm" union
select to_date('2020-10-22','YYYY-MM-DD') "time", 'A' "type", 115 "lkm" union
select to_date('2020-10-23','YYYY-MM-DD') "time", 'A' "type", 171 "lkm" union
select to_date('2020-10-24','YYYY-MM-DD') "time", 'A' "type", 172 "lkm" union
select to_date('2020-10-25','YYYY-MM-DD') "time", 'A' "type", 135 "lkm" union
select to_date('2020-10-26','YYYY-MM-DD') "time", 'A' "type", 84 "lkm" union
select to_date('2020-10-27','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2020-10-28','YYYY-MM-DD') "time", 'A' "type", 113 "lkm" union
select to_date('2020-10-29','YYYY-MM-DD') "time", 'A' "type", 166 "lkm" union
select to_date('2020-10-30','YYYY-MM-DD') "time", 'A' "type", 125 "lkm" union
select to_date('2020-10-31','YYYY-MM-DD') "time", 'A' "type", 112 "lkm" union
select to_date('2020-11-01','YYYY-MM-DD') "time", 'A' "type", 129 "lkm" union
select to_date('2020-11-02','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2020-11-03','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2020-11-04','YYYY-MM-DD') "time", 'A' "type", 116 "lkm" union
select to_date('2020-11-05','YYYY-MM-DD') "time", 'A' "type", 194 "lkm" union
select to_date('2020-11-06','YYYY-MM-DD') "time", 'A' "type", 141 "lkm" union
select to_date('2020-11-07','YYYY-MM-DD') "time", 'A' "type", 159 "lkm" union
select to_date('2020-11-08','YYYY-MM-DD') "time", 'A' "type", 111 "lkm" union
select to_date('2020-11-09','YYYY-MM-DD') "time", 'A' "type", 92 "lkm" union
select to_date('2020-11-10','YYYY-MM-DD') "time", 'A' "type", 133 "lkm" union
select to_date('2020-11-11','YYYY-MM-DD') "time", 'A' "type", 185 "lkm" union
select to_date('2020-11-12','YYYY-MM-DD') "time", 'A' "type", 140 "lkm" union
select to_date('2020-11-13','YYYY-MM-DD') "time", 'A' "type", 190 "lkm" union
select to_date('2020-11-14','YYYY-MM-DD') "time", 'A' "type", 108 "lkm" union
select to_date('2020-11-15','YYYY-MM-DD') "time", 'A' "type", 167 "lkm" union
select to_date('2020-11-16','YYYY-MM-DD') "time", 'A' "type", 116 "lkm" union
select to_date('2020-11-17','YYYY-MM-DD') "time", 'A' "type", 189 "lkm" union
select to_date('2020-11-18','YYYY-MM-DD') "time", 'A' "type", 174 "lkm" union
select to_date('2020-11-19','YYYY-MM-DD') "time", 'A' "type", 116 "lkm" union
select to_date('2020-11-20','YYYY-MM-DD') "time", 'A' "type", 152 "lkm" union
select to_date('2020-11-21','YYYY-MM-DD') "time", 'A' "type", 162 "lkm" union
select to_date('2020-11-22','YYYY-MM-DD') "time", 'A' "type", 196 "lkm" union
select to_date('2020-11-23','YYYY-MM-DD') "time", 'A' "type", 92 "lkm" union
select to_date('2020-11-24','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2020-11-25','YYYY-MM-DD') "time", 'A' "type", 134 "lkm" union
select to_date('2020-11-26','YYYY-MM-DD') "time", 'A' "type", 186 "lkm" union
select to_date('2020-11-27','YYYY-MM-DD') "time", 'A' "type", 112 "lkm" union
select to_date('2020-11-28','YYYY-MM-DD') "time", 'A' "type", 115 "lkm" union
select to_date('2020-11-29','YYYY-MM-DD') "time", 'A' "type", 166 "lkm" union
select to_date('2020-11-30','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2020-12-01','YYYY-MM-DD') "time", 'A' "type", 96 "lkm" union
select to_date('2020-12-02','YYYY-MM-DD') "time", 'A' "type", 141 "lkm" union
select to_date('2020-12-03','YYYY-MM-DD') "time", 'A' "type", 102 "lkm" union
select to_date('2020-12-04','YYYY-MM-DD') "time", 'A' "type", 124 "lkm" union
select to_date('2020-12-05','YYYY-MM-DD') "time", 'A' "type", 117 "lkm" union
select to_date('2020-12-06','YYYY-MM-DD') "time", 'A' "type", 144 "lkm" union
select to_date('2020-12-07','YYYY-MM-DD') "time", 'A' "type", 82 "lkm" union
select to_date('2020-12-08','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2020-12-09','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2020-12-10','YYYY-MM-DD') "time", 'A' "type", 118 "lkm" union
select to_date('2020-12-11','YYYY-MM-DD') "time", 'A' "type", 166 "lkm" union
select to_date('2020-12-12','YYYY-MM-DD') "time", 'A' "type", 169 "lkm" union
select to_date('2020-12-13','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2020-12-14','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2020-12-15','YYYY-MM-DD') "time", 'A' "type", 85 "lkm" union
select to_date('2020-12-16','YYYY-MM-DD') "time", 'A' "type", 99 "lkm" union
select to_date('2020-12-17','YYYY-MM-DD') "time", 'A' "type", 97 "lkm" union
select to_date('2020-12-18','YYYY-MM-DD') "time", 'A' "type", 125 "lkm" union
select to_date('2020-12-19','YYYY-MM-DD') "time", 'A' "type", 121 "lkm" union
select to_date('2020-12-20','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2020-12-21','YYYY-MM-DD') "time", 'A' "type", 84 "lkm" union
select to_date('2020-12-22','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-12-23','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-12-24','YYYY-MM-DD') "time", 'A' "type", 86 "lkm" union
select to_date('2020-12-25','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2020-12-26','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2020-12-27','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2020-12-28','YYYY-MM-DD') "time", 'A' "type", 74 "lkm" union
select to_date('2020-12-29','YYYY-MM-DD') "time", 'A' "type", 75 "lkm" union
select to_date('2020-12-30','YYYY-MM-DD') "time", 'A' "type", 73 "lkm" union
select to_date('2020-12-31','YYYY-MM-DD') "time", 'A' "type", 77 "lkm" union
select to_date('2021-01-01','YYYY-MM-DD') "time", 'A' "type", 74 "lkm" union
select to_date('2021-01-02','YYYY-MM-DD') "time", 'A' "type", 73 "lkm" union
select to_date('2021-01-03','YYYY-MM-DD') "time", 'A' "type", 70 "lkm" union
select to_date('2021-01-04','YYYY-MM-DD') "time", 'A' "type", 64 "lkm" union
select to_date('2021-01-05','YYYY-MM-DD') "time", 'A' "type", 77 "lkm" union
select to_date('2021-01-06','YYYY-MM-DD') "time", 'A' "type", 83 "lkm" union
select to_date('2021-01-07','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2021-01-08','YYYY-MM-DD') "time", 'A' "type", 89 "lkm" union
select to_date('2021-01-09','YYYY-MM-DD') "time", 'A' "type", 83 "lkm" union
select to_date('2021-01-10','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2021-01-11','YYYY-MM-DD') "time", 'A' "type", 74 "lkm" union
select to_date('2021-01-12','YYYY-MM-DD') "time", 'A' "type", 73 "lkm" union
select to_date('2021-01-13','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2021-01-14','YYYY-MM-DD') "time", 'A' "type", 88 "lkm" union
select to_date('2021-01-15','YYYY-MM-DD') "time", 'A' "type", 88 "lkm" union
select to_date('2021-01-16','YYYY-MM-DD') "time", 'A' "type", 84 "lkm" union
select to_date('2021-01-17','YYYY-MM-DD') "time", 'A' "type", 85 "lkm" union
select to_date('2021-01-18','YYYY-MM-DD') "time", 'A' "type", 68 "lkm" union
select to_date('2021-01-19','YYYY-MM-DD') "time", 'A' "type", 76 "lkm" union
select to_date('2021-01-20','YYYY-MM-DD') "time", 'A' "type", 83 "lkm" union
select to_date('2021-01-21','YYYY-MM-DD') "time", 'A' "type", 88 "lkm" union
select to_date('2021-01-22','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2021-01-23','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2021-01-24','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2021-01-25','YYYY-MM-DD') "time", 'A' "type", 76 "lkm" union
select to_date('2021-01-26','YYYY-MM-DD') "time", 'A' "type", 73 "lkm" union
select to_date('2021-01-27','YYYY-MM-DD') "time", 'A' "type", 84 "lkm" union
select to_date('2021-01-28','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2021-01-29','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2021-01-30','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2021-01-31','YYYY-MM-DD') "time", 'A' "type", 82 "lkm" union
select to_date('2021-02-01','YYYY-MM-DD') "time", 'A' "type", 72 "lkm" union
select to_date('2021-02-02','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2021-02-03','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2021-02-04','YYYY-MM-DD') "time", 'A' "type", 89 "lkm" union
select to_date('2021-02-05','YYYY-MM-DD') "time", 'A' "type", 92 "lkm" union
select to_date('2021-02-06','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2021-02-07','YYYY-MM-DD') "time", 'A' "type", 82 "lkm" union
select to_date('2021-02-08','YYYY-MM-DD') "time", 'A' "type", 75 "lkm" union
select to_date('2021-02-09','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2021-02-10','YYYY-MM-DD') "time", 'A' "type", 83 "lkm" union
select to_date('2021-02-11','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2021-02-12','YYYY-MM-DD') "time", 'A' "type", 96 "lkm" union
select to_date('2021-02-13','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2021-02-14','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2021-02-15','YYYY-MM-DD') "time", 'A' "type", 75 "lkm" union
select to_date('2021-02-16','YYYY-MM-DD') "time", 'A' "type", 88 "lkm" union
select to_date('2021-02-17','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2021-02-18','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2021-02-19','YYYY-MM-DD') "time", 'A' "type", 100 "lkm" union
select to_date('2021-02-20','YYYY-MM-DD') "time", 'A' "type", 99 "lkm" union
select to_date('2021-02-21','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2021-02-22','YYYY-MM-DD') "time", 'A' "type", 72 "lkm" union
select to_date('2021-02-23','YYYY-MM-DD') "time", 'A' "type", 85 "lkm" union
select to_date('2021-02-24','YYYY-MM-DD') "time", 'A' "type", 83 "lkm" union
select to_date('2021-02-25','YYYY-MM-DD') "time", 'A' "type", 85 "lkm" union
select to_date('2021-02-26','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2021-02-27','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2021-02-28','YYYY-MM-DD') "time", 'A' "type", 81 "lkm" union
select to_date('2021-03-01','YYYY-MM-DD') "time", 'A' "type", 73 "lkm" union
select to_date('2021-03-02','YYYY-MM-DD') "time", 'A' "type", 89 "lkm" union
select to_date('2021-03-03','YYYY-MM-DD') "time", 'A' "type", 89 "lkm" union
select to_date('2021-03-04','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2021-03-05','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2021-03-06','YYYY-MM-DD') "time", 'A' "type", 94 "lkm" union
select to_date('2021-03-07','YYYY-MM-DD') "time", 'A' "type", 96 "lkm" union
select to_date('2021-03-08','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2021-03-09','YYYY-MM-DD') "time", 'A' "type", 86 "lkm" union
select to_date('2021-03-10','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2021-03-11','YYYY-MM-DD') "time", 'A' "type", 96 "lkm" union
select to_date('2021-03-12','YYYY-MM-DD') "time", 'A' "type", 101 "lkm" union
select to_date('2021-03-13','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2021-03-14','YYYY-MM-DD') "time", 'A' "type", 99 "lkm" union
select to_date('2021-03-15','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2021-03-16','YYYY-MM-DD') "time", 'A' "type", 83 "lkm" union
select to_date('2021-03-17','YYYY-MM-DD') "time", 'A' "type", 99 "lkm" union
select to_date('2021-03-18','YYYY-MM-DD') "time", 'A' "type", 95 "lkm" union
select to_date('2021-03-19','YYYY-MM-DD') "time", 'A' "type", 111 "lkm" union
select to_date('2021-03-20','YYYY-MM-DD') "time", 'A' "type", 122 "lkm" union
select to_date('2021-03-21','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2021-03-22','YYYY-MM-DD') "time", 'A' "type", 80 "lkm" union
select to_date('2021-03-23','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2021-03-24','YYYY-MM-DD') "time", 'A' "type", 99 "lkm" union
select to_date('2021-03-25','YYYY-MM-DD') "time", 'A' "type", 127 "lkm" union
select to_date('2021-03-26','YYYY-MM-DD') "time", 'A' "type", 179 "lkm" union
select to_date('2021-03-27','YYYY-MM-DD') "time", 'A' "type", 171 "lkm" union
select to_date('2021-03-28','YYYY-MM-DD') "time", 'A' "type", 116 "lkm" union
select to_date('2021-03-29','YYYY-MM-DD') "time", 'A' "type", 86 "lkm" union
select to_date('2021-03-30','YYYY-MM-DD') "time", 'A' "type", 95 "lkm" union
select to_date('2021-03-31','YYYY-MM-DD') "time", 'A' "type", 106 "lkm" union
select to_date('2021-04-01','YYYY-MM-DD') "time", 'A' "type", 125 "lkm" union
select to_date('2021-04-02','YYYY-MM-DD') "time", 'A' "type", 177 "lkm" union
select to_date('2021-04-03','YYYY-MM-DD') "time", 'A' "type", 156 "lkm" union
select to_date('2021-04-04','YYYY-MM-DD') "time", 'A' "type", 127 "lkm" union
select to_date('2021-04-05','YYYY-MM-DD') "time", 'A' "type", 96 "lkm" union
select to_date('2021-04-06','YYYY-MM-DD') "time", 'A' "type", 84 "lkm" union
select to_date('2021-04-07','YYYY-MM-DD') "time", 'A' "type", 96 "lkm" union
select to_date('2021-04-08','YYYY-MM-DD') "time", 'A' "type", 95 "lkm" union
select to_date('2021-04-09','YYYY-MM-DD') "time", 'A' "type", 130 "lkm" union
select to_date('2021-04-10','YYYY-MM-DD') "time", 'A' "type", 123 "lkm" union
select to_date('2021-04-11','YYYY-MM-DD') "time", 'A' "type", 94 "lkm" union
select to_date('2021-04-12','YYYY-MM-DD') "time", 'A' "type", 88 "lkm" union
select to_date('2021-04-13','YYYY-MM-DD') "time", 'A' "type", 95 "lkm" union
select to_date('2021-04-14','YYYY-MM-DD') "time", 'A' "type", 97 "lkm" union
select to_date('2021-04-15','YYYY-MM-DD') "time", 'A' "type", 157 "lkm" union
select to_date('2021-04-16','YYYY-MM-DD') "time", 'A' "type", 101 "lkm" union
select to_date('2021-04-17','YYYY-MM-DD') "time", 'A' "type", 111 "lkm" union
select to_date('2021-04-18','YYYY-MM-DD') "time", 'A' "type", 145 "lkm" union
select to_date('2021-04-19','YYYY-MM-DD') "time", 'A' "type", 94 "lkm" union
select to_date('2021-04-20','YYYY-MM-DD') "time", 'A' "type", 95 "lkm" union
select to_date('2021-04-21','YYYY-MM-DD') "time", 'A' "type", 132 "lkm" union
select to_date('2021-04-22','YYYY-MM-DD') "time", 'A' "type", 190 "lkm" union
select to_date('2021-04-23','YYYY-MM-DD') "time", 'A' "type", 119 "lkm" union
select to_date('2021-04-24','YYYY-MM-DD') "time", 'A' "type", 109 "lkm" union
select to_date('2021-04-25','YYYY-MM-DD') "time", 'A' "type", 163 "lkm" union
select to_date('2021-04-26','YYYY-MM-DD') "time", 'A' "type", 96 "lkm" union
select to_date('2021-04-27','YYYY-MM-DD') "time", 'A' "type", 94 "lkm" union
select to_date('2021-04-28','YYYY-MM-DD') "time", 'A' "type", 136 "lkm" union
select to_date('2021-04-29','YYYY-MM-DD') "time", 'A' "type", 163 "lkm" union
select to_date('2021-04-30','YYYY-MM-DD') "time", 'A' "type", 190 "lkm" union
select to_date('2021-05-01','YYYY-MM-DD') "time", 'A' "type", 178 "lkm" union
select to_date('2021-05-02','YYYY-MM-DD') "time", 'A' "type", 111 "lkm" union
select to_date('2021-05-03','YYYY-MM-DD') "time", 'A' "type", 83 "lkm" union
select to_date('2021-05-04','YYYY-MM-DD') "time", 'A' "type", 93 "lkm" union
select to_date('2021-05-05','YYYY-MM-DD') "time", 'A' "type", 92 "lkm" union
select to_date('2021-05-06','YYYY-MM-DD') "time", 'A' "type", 148 "lkm" union
select to_date('2021-05-07','YYYY-MM-DD') "time", 'A' "type", 198 "lkm" union
select to_date('2021-05-08','YYYY-MM-DD') "time", 'A' "type", 193 "lkm" union
select to_date('2021-05-09','YYYY-MM-DD') "time", 'A' "type", 123 "lkm" union
select to_date('2021-05-10','YYYY-MM-DD') "time", 'A' "type", 86 "lkm" union
select to_date('2021-05-11','YYYY-MM-DD') "time", 'A' "type", 92 "lkm" union
select to_date('2021-05-12','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2021-05-13','YYYY-MM-DD') "time", 'A' "type", 115 "lkm" union
select to_date('2021-05-14','YYYY-MM-DD') "time", 'A' "type", 113 "lkm" union
select to_date('2021-05-15','YYYY-MM-DD') "time", 'A' "type", 98 "lkm" union
select to_date('2021-05-16','YYYY-MM-DD') "time", 'A' "type", 99 "lkm" union
select to_date('2021-05-17','YYYY-MM-DD') "time", 'A' "type", 79 "lkm" union
select to_date('2021-05-18','YYYY-MM-DD') "time", 'A' "type", 88 "lkm" union
select to_date('2021-05-19','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2021-05-20','YYYY-MM-DD') "time", 'A' "type", 99 "lkm" union
select to_date('2021-05-21','YYYY-MM-DD') "time", 'A' "type", 116 "lkm" union
select to_date('2021-05-22','YYYY-MM-DD') "time", 'A' "type", 141 "lkm" union
select to_date('2021-05-23','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2021-05-24','YYYY-MM-DD') "time", 'A' "type", 85 "lkm" union
select to_date('2021-05-25','YYYY-MM-DD') "time", 'A' "type", 86 "lkm" union
select to_date('2021-05-26','YYYY-MM-DD') "time", 'A' "type", 91 "lkm" union
select to_date('2021-05-27','YYYY-MM-DD') "time", 'A' "type", 100 "lkm" union
select to_date('2021-05-28','YYYY-MM-DD') "time", 'A' "type", 161 "lkm" union
select to_date('2021-05-29','YYYY-MM-DD') "time", 'A' "type", 152 "lkm" union
select to_date('2021-05-30','YYYY-MM-DD') "time", 'A' "type", 99 "lkm" union
select to_date('2021-05-31','YYYY-MM-DD') "time", 'A' "type", 78 "lkm" union
select to_date('2021-06-01','YYYY-MM-DD') "time", 'A' "type", 87 "lkm" union
select to_date('2021-06-02','YYYY-MM-DD') "time", 'A' "type", 86 "lkm" union
select to_date('2021-06-03','YYYY-MM-DD') "time", 'A' "type", 96 "lkm" union
select to_date('2021-06-04','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2021-06-05','YYYY-MM-DD') "time", 'A' "type", 95 "lkm" union
select to_date('2021-06-06','YYYY-MM-DD') "time", 'A' "type", 90 "lkm" union
select to_date('2021-06-07','YYYY-MM-DD') "time", 'A' "type", 72 "lkm" union
select to_date('2021-06-08','YYYY-MM-DD') "time", 'A' "type", 84 "lkm" union
select to_date('2021-06-09','YYYY-MM-DD') "time", 'A' "type", 83 "lkm"

insert into SCHEMA_NAME.TABLE_NAME (select dateadd(days,-1,"time") as "time", 'B' as "type", "lkm"/2 as "lkm" from SCHEMA_NAME.TABLE_NAME);

delete from SCHEMA_NAME.TABLE_NAME where "time" between to_date('2021-04-29','YYYY-MM-DD') and to_date('2021-05-29','YYYY-MM-DD') and "type" = 'B';
delete from SCHEMA_NAME.TABLE_NAME where "time" between to_date('2021-01-20','YYYY-MM-DD') and to_date('2021-01-22','YYYY-MM-DD') and "type" = 'B';
delete from SCHEMA_NAME.TABLE_NAME where "time" between to_date('2021-02-15','YYYY-MM-DD') and to_date('2021-02-22','YYYY-MM-DD') and "type" = 'B';
delete from SCHEMA_NAME.TABLE_NAME where "time" between to_date('2020-11-01','YYYY-MM-DD') and to_date('2020-11-29','YYYY-MM-DD') and "type" = 'B';
delete from SCHEMA_NAME.TABLE_NAME where "time" between to_date('2020-09-01','YYYY-MM-DD') and to_date('2021-06-10','YYYY-MM-DD') and "type" = 'A';


This is then queried from grafana with

select "time", "type", "lkm" from SCHEMA_NAME.TABLE_NAME
order by 1

Then in ‘Transforms’ we do a ‘Concatenate fields’ and ‘Organize fields’ as in screenshot. There is the buggy point at the cursor with strange time stamp.

It is interesting that when time columns are switched around, we get rid of the last point.

And here’s snapshots from data inspection - it does not show the strange point in last row of Series A.

After this analysis I think it is result from how x-axis with gaps is handled in transformation and I will try to fix this through handling data more carefully.

very interesting,

I’d like to try and replicate this, but in the meantime:

Have you considered upgrading to a newer version? Grafana 8 just shipped this week, and 7.3.1 is now like 8 months old. There is also a brand new time series panel with much greater power. Check it out:

or run it in a container, with the new Unified Alerting feature turned on:

docker run -p 3000:3000 --name=grafana -e "GF_FEATURE_TOGGLES_ENABLE=ngalert" grafana/grafana:8.0.0

1 Like

Ok, that version looks nice!

I noticed that also v7.4 was out and had nice features. Thanks for the tip!

1 Like