Hello
Image a following table be manipulated by TDBCrossTabSource:
//---- Table Data----------
Year |Region |Sales
2000 |East | 1000
2000 |West |1500
2001 |East |1200
2002 |East |1700
2002 |West |2300
//------ TDBCrossTabSource settings---------
Group on "Region" to sum the "sales" with Label on "Year"
The for the series for region "West", it will have a 0 value on year 2001 instead of a NULL value, which is wrong. Since region "west" has no data on "year" 2001, it should skip it, or adding a NULL value instead of a 0 value.
Please kindly review and correct it.
[Bug]TDBCrossTabSource manipulates for 0 instead of NULL
Re: [Bug]TDBCrossTabSource manipulates for 0 instead of NULL
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: [Bug]TDBCrossTabSource manipulates for 0 instead of NULL
Hi
It is a different case.
In my case, there is no record at all for region west in year 2001 in dataset, not a 0, or a NULL value. But when use DBCrossTabSource, a 0 value is assigned, which make the display wrong.
So in my case, more accurately, when DBCrossTabSource manipulates value for series "west", it should skip year 2001, or calling AddNULL for year 2001, not like currently adding a 0 value for year 2001.
Actually after two days try, I managed to achieve it by modify TeeDBCrossTab.pas, starting line 305
into
It is a different case.
In my case, there is no record at all for region west in year 2001 in dataset, not a 0, or a NULL value. But when use DBCrossTabSource, a 0 value is assigned, which make the display wrong.
So in my case, more accurately, when DBCrossTabSource manipulates value for series "west", it should skip year 2001, or calling AddNULL for year 2001, not like currently adding a 0 value for year 2001.
Actually after two days try, I managed to achieve it by modify TeeDBCrossTab.pas, starting line 305
Code: Select all
if tmpPoint=-1 then
begin
tmpSeries.Add(tmpValue,tmpLabel,clTeeColor);
with Series.ParentChart do
for t:=0 to SeriesCount-1 do
if tmpSeries<>Series[t] then
if tmpSeries.Count>Series[t].Count then
for tt:=1 to (tmpSeries.Count-Series[t].Count) do
begin
Series[t].Add(0,tmpLabel);
end;
end
else
begin
With tmpSeries.MandatoryValueList do
case Formula of
gfCount,
gfSum: Value[tmpPoint]:=Value[tmpPoint]+tmpValue;
end;
end;
end;
into
Code: Select all
if tmpPoint=-1 then
begin
tmpSeries.Add(tmpValue,tmpLabel,clTeeColor);
with Series.ParentChart do
for t:=0 to SeriesCount-1 do
if tmpSeries<>Series[t] then
if tmpSeries.Count>Series[t].Count then
for tt:=1 to (tmpSeries.Count-Series[t].Count) do
begin
Series[t].AddNull(TmpLabel); // Occupy it with a NULL value
end;
end
else
begin
With tmpSeries.MandatoryValueList do
case Formula of
gfCount,
gfSum:begin
Value[tmpPoint]:=Value[tmpPoint]+tmpValue;
tmpSeries.ValueColor[tmpPoint]:=clTeeColor;//now this should be a valid value
end;
end;
end;
Re: [Bug]TDBCrossTabSource manipulates for 0 instead of NULL
Hello
line 284 should also be change as following in case the series "west" is the master series
line 284 should also be change as following in case the series "west" is the master series
Code: Select all
for t:=0 to Series.Count-1 do
tmpSeries.AddNULL(Series.Labels[t]);
Re: [Bug]TDBCrossTabSource manipulates for 0 instead of NULL
Hi,
Thanks for sharing the proposal. I've added it to the wish list to be investigated for inclusion asap (TV52016090).
Thanks for sharing the proposal. I've added it to the wish list to be investigated for inclusion asap (TV52016090).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |