Countnig Dimensional Items?

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

Moderator: Alex Zencovich

Postby anaves » Tue Feb 13, 2007 7:55 pm

Hi Guillaumep. I'm sorry, I've first told about clients and sent "Drivers" in the example, sorry. But the problem is the same.

1- No, the facts are not all related to the same client. And if I change the dimension from Drivers ( Entregador ) to Clients the result is the same, I mean, I have 1 in all rows, even at the TOTAL column botton.

I have already created the measure ctCount using Client name. Still the TOTAL is not showing, I think this is my main problem, cannot see TOTAL.
Curiouslly, the effect is the same using dim Clients or dim Drivers, I mean, 1 is showing in all rows. I have only ctCount for Clients

We can try an example using de DemoCube, maybe it'll easy for us.

And really tks for your kind attenttion.
anaves
Developer
 
Posts: 25
Joined: Mon Oct 30, 2006 2:06 pm

Postby AlexZencovich » Tue Feb 20, 2007 3:59 pm

I think you all mix a measure values (saved in facts) and dimension counting (not saved in facts but exists as separate nature values).

When you try to get value as measure you see in facts. If you have 5 customers and 10000 records in facts, you will get various combinations of 10000 div 5 eg C1+C2+C3+C4+C5 = 10000. It is result which always should be right.

Except if you not set filters, of course.

Just because with facts you got answer not to HowMany clientes visited to shop at Friday but how many money spend did each client (all clientes at friday etc) or hjow many purchases they are did. If overall number of purchases is 10000 (one purchase = one row)

There is OLAP nature and major difference from universal inquiry system.

You cannot get infoirmation how many clientes visited shop at Friday with plays with distincts etc. With any plays with measure values.

You should look in dimension.

Let we have dimension

Shop->DayOfWeek->Client

then

TPivotMap.RowCells.ChildCount return number of shops
TPivotMap.RowCells[0].ChildCount return 7 (days in week) if RowCells[0] is expanded (not collapsed) or 0

TPivotMap.RowCells[1] = TPivotMap.RowCells[0].Childs[0] = 'Monday'

so

TPivotMap.RowCells[1] .ChildCount - is answer to question - how many clientes visited a shop0 at Monday

But there s not measure so there are no place for this information in TPivotGrid. You may put it in 'template measure' or somewhere else. But it is not OLAP-related question - if you place dimension Year at columns, number of clientes still not changed even if some clientes no visited shop0 at any day in 2006 but only in 2005 - they still in cross (until you filter out all except 2005).


Pity, but PivotCube does not allow to use string (or date) fields as measure source. In that case you may do the next.

See how works access to detail in demo app and run similar code in OnCalcCustomMeasure event. In detail dataset you will get number of records used for current cell agregation and you may work with string or date fields too. Even get distinct dataset for chosen fields.
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

Previous

Return to PivotCube VCL

Who is online

Users browsing this forum: No registered users and 2 guests

cron