Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Many to one filtering while aggregating at the same time

Hi all,

 

I have 2 tables, A and B. A looks as follow:

id_uniquevar 1 var 2
110
210
301
............

 

And B looks as follow (not all "id_unique" of table A is in "id" and "id" is also not unique):

idproducthave bought?
1A1
3B0
3C1
...........

 

I enabled the many-to-one relationship between the two tables using the column id_unique and id respectively.

 

I'd like to get the % of products purchased per product. One way that I've tried is to use the column "product" in table B as axis and average of "have bought" as values. However, this won't enable me to use table B to filter A. Another method I tried was to remove all the rows with 0s in "have bought?" and it works to filter, but the problem is that now I can get the count but not the %. I tried to use a measure from Table A to count number of rows in A and then divide count in b with that measure, but it would only take into account all the rows that has common id between the two tables. Would love to get your feedback on this. Thank you so much!

1 Reply

  • Hi,

    Your question is not clear.  What are the Var 1 and Var 2 columns in Table 1?  What end result are you expecting?  Please show that clearly.