Percent Calc How to ... ?

Discussion forum for PivotCubeX component. Common usage questions. Bug and problem reports

Moderator: Alex Zencovich

Percent Calc How to ... ?

Postby raul » Fri Nov 03, 2006 10:31 am

Hi Alex, i have this colunms in Excel:

custno, cost , benefit , %benperc

1-------1000--------500--------50% <- =(benefit/cost*100)
2-------3000-------1800-------60% "
Tot-----4000-------2300-------57% <- =(benefit.tot/cost.tot*100)

In cube using measures...
- custno, cost , benefit , %benperc

-------1-------1000-------500-------50%
-------2-------3000------1800-------60%
________________________________
------tot------4000------2300------110 (summa, summa, summa) or ...
-------------- 4000------2300-------55 (summa, summa, average)
or ... any measure

How can I get the correct percent (2300/4000*100) => (57%) ??
I need always to divide totals as result
thanks
raul
User
 
Posts: 9
Joined: Mon Oct 30, 2006 9:39 pm

Postby AlexZencovich » Mon Nov 06, 2006 7:54 am

Add calc. measure like "% of benefit" with formula

begin
Result = "benefit"[VALUE]/"cost"[VALUE];
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

Adding calc measures

Postby raul » Mon Nov 06, 2006 2:22 pm

Thanks,
Can I add Programmaticaly a calc meassure with formula or import the formula from the formula cell in excel sheet?
raul
User
 
Posts: 9
Joined: Mon Oct 30, 2006 9:39 pm

Postby AlexZencovich » Mon Nov 06, 2006 5:10 pm

1. Yes, you can do it with
PCX.MapAddCalculatedMeasure(const Name: WideString; const Formula: WideString)

2. I do not sure if Excel sheet formulas are compatible with built-in langauge
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


Return to PivotCube ActiveX

Who is online

Users browsing this forum: No registered users and 3 guests

cron