Calculating % variation

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

Moderator: Alex Zencovich

Calculating % variation

Postby vittorio » Sun Jul 30, 2006 9:36 pm

I have wrapped to years some calculated values, put the years in columns, and would like to add programmatically a column to the right of each year with the % variation calculated on the value of the previous year.

Is it possible? How?
Thanks
vittorio
User
 
Posts: 5
Joined: Sun Jul 30, 2006 9:24 pm

Postby AlexZencovich » Mon Jul 31, 2006 3:31 pm

You may do it as calc. measure over variation (ctVariation) measure. You need only check which year you will take as base.
Most easy way - take calc. measure like

Result = 100 * (Sum[Value] - Sum[PREV_BY_ROW])/Sum[Value];
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

gives me an error

Postby vittorio » Fri Aug 04, 2006 8:38 pm

HI,
tried to do as per your post but

- didn't find ctVariation but only ctVariance (don't think it is the same measure)

- Result = 100 * (Sum[Value] - Sum[PREV_BY_ROW])/Sum[Value] as a calculated measure over my measure gives an error but I can't understand why
vittorio
User
 
Posts: 5
Joined: Sun Jul 30, 2006 9:24 pm

continued

Postby vittorio » Fri Aug 04, 2006 8:40 pm

it would be great a complete sample code in VB2005 - I didn't find anything that helps in the help file
thanks
vittorio
User
 
Posts: 5
Joined: Sun Jul 30, 2006 9:24 pm

Postby AlexZencovich » Sat Aug 05, 2006 7:52 am

1. I do not provide development in VB2005. Sorry.
2. I also could not understand why because your formula works fine with demo examples
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