Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a problem with the parent child calculation in my pivot table. I have a dimension as product_id and I want to count of the products which are the child of the particular product_id. I can't use the "parent_id" as a dimension because of the remaining part of the table.
For example. Product 1 has three children product as 2,3 and 4. All the products except the parents contains the parent_id. For product 2 product_id=2 and parent_id = 1. My table should look like this.
product_id | Count of the childs |
---|---|
1 | 3 |
I will be glad if you help me.
Look on first column of your chart,
I hope it helps!
Of course let me know if you have some questions
regards
Darek
Write like
Count(Distint Child Id)
If possible provide sample for this
Can you post your sample data file or apps?
The sample file is attached. In this example the chart should show 3 as the number of the children when the 170769 selected. Again I can not use parent_id as dimension.
are you sure the answer should be 3 and not 4?
use as below
count(TOTAL product_id)
If you count product_id in place of the parent_id for child id and i think it is 4 not 3 explain with more example.
Write like for straight table
Dimension :- product_id
Expression :-
Count(All parent_id)
Or
Count(All parent_id)
You are right it will be 4. I mistyped it. count(total product_id) won't work because there are other products in the list. I will add other products to the file. The result should be product 170769 has 4 children and 209057 has 5 children.
COUNT(TOTAL <parent_id> DISTINCT product_id)
Hi Manish, your calculation will work if I use "parent_id" as a dimension. On the other hand, my dimension has to be "product_id". I think the hard part of the problem is this.