how to clear inactive items

Discussion forum for PivotCube VCL users. Common questions. Bug and problem reports

Moderator: Alex Zencovich

how to clear inactive items

Postby bobibp » Sat Jan 10, 2009 7:50 am

How to clear inactive dimension items, becouse when I save a map file with data in it with query for 01.12.2006 to 31.12.2006 (for example) and after that when I load the map file with query for period 01.11.2006-3011.2006 the old data for 12th month is staying inactive I want to clear them. How?
bobibp
User
 
Posts: 15
Joined: Sat Jan 10, 2009 7:43 am

Re: how to clear inactive items

Postby AlexZencovich » Sat Jan 10, 2009 9:26 am

Try to set TPivotCube.Dimensions[Index].EmptyItems = diRemove

it have to help in most cases. If it does not help, force it by next

after map loaded add next code

TPivotMap.Dimensions[Index].HierarchyChanged := True;
TPivotMap.RefreshData(True);
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am

Re: how to clear inactive items

Postby bobibp » Sat Jan 10, 2009 12:45 pm

This doesn't help. Before this the inactive items were in the right list. Now after this, they are in the left list together with the new correct items
bobibp
User
 
Posts: 15
Joined: Sat Jan 10, 2009 7:43 am

Re: how to clear inactive items

Postby bobibp » Sat Jan 10, 2009 1:19 pm

I just want to clear(delete) the gray items in the lists
bobibp
User
 
Posts: 15
Joined: Sat Jan 10, 2009 7:43 am

Re: how to clear inactive items

Postby AlexZencovich » Sat Jan 10, 2009 10:05 pm

Then try next code

var
dim : TMapDimension;
item : TMapDimensionItem;
i : integer;

begin
dim := PivotMap1.Dimensions[Index]; //get appropriate dimension
for i := dim.Count - 1 downto 0 do
begin
item := dim.Items[i];
if item.Empty then
dim.DeleteItem(item);
end;
PivotMap1.refreshData(True);
end;
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am

Re: how to clear inactive items

Postby bobibp » Wed Jan 14, 2009 7:58 am

Hi this helps thanks , but there is another problem.

When I saved data for filtered dimension in which for example (vendor=101 is set to red(inactive)). The next time I load the data for this dimension , but from query with another params and the same vendor exists there. The Vendor is not filtered.

Do you have any ideas?
bobibp
User
 
Posts: 15
Joined: Sat Jan 10, 2009 7:43 am

Re: how to clear inactive items

Postby bobibp » Wed Jan 14, 2009 9:40 am

It's done thanks
bobibp
User
 
Posts: 15
Joined: Sat Jan 10, 2009 7:43 am


Return to PivotCube VCL

Who is online

Users browsing this forum: No registered users and 7 guests

cron