简体   繁体   中英

LoD expression to calculate the average count of one dimension id based on another dimension id in Tableau

I have a dataset consisting of unique trips (IDs), users_id, and bikes_id and time-stamp trips_id, users_id, and bikes_id are dimensions:

  1. A trip_id is unique
  2. A user can have multiple bikes_id and trips_id
  3. A bike can have multiple rides and multiple users

I would like to show how many rides there are (on average) per user, how many bikes are used (on average) by user and how many rides there are per bike. Is there a calculated field or LoD that can do this calculations? So I can show per week, month or another time period?

I would like to show how many rides there are (on average) per user

use this CF (average for whole data)

{AVG({FIXED [USER] : COUNTD(TRIP_ID)})}

how many bikes are used (on average) by user

use this

{AVG({FIXED [user]: countd(bike_id)})}

how many rides there are per bike

use this

{AVG({FIXED [bike_id]: countd(trip_id)})}

NOTE these calcs will give you average for whole dataset

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM