Forum Discussion

norman123123's avatar
norman123123
Frequent Visitor
4 years ago

How to count rows from one table based on another table with a filter

I have two tables, Real and Plan, with the following column names:
Table 1: REAL

distance, track, date

 

Table 2: PLAN

planned_distance, planned_track, date

 

What I need to do is calculate adherance to the plan by counting how many tracks were actually ran that were on the plan, for each day. In other words, from the planned tracks to be ran in each day, how many were actually ran.

 

I tried something like:

COUNTX( REAL,
             FILTER( PLAN, PLAN[distance] > 0 && REAL[distance] > 0 )
)

 

But it´s not working, I need the count of the tracks that were in plan and actually ran.

Does anyone have an idea on how to do this?