Forum Discussion

duncanelliot's avatar
duncanelliot
Frequent Visitor
9 years ago
Solved

Append and shape data

Hi there,   My requirements are fairly complex and am hoping someone might be able to help out.   At a high level, I want to plot user activity on a map. - Users can either register or transact....
  • Eric_Zhang's avatar
    9 years ago

    duncanelliot

     

    It seems that you're looking for a UNION calculated table. What is the logic to determine 1st transaction and so on.

     

     

    union table =
    UNION (
        SELECTCOLUMNS (
            Locations,
            "Table", "Location",
            "Created on", "",
            "Created on_Location", Locations[Created On ],
            "event type", "event type",
            "lat", Locations[Lat],
            "long", Locations[Long],
            "userid", "",
            "locationid", Locations[Id]
        ),
        SELECTCOLUMNS (
            Transactions,
            "Table", "Transactions",
            "Created on", Transactions[Created On ],
            "Created on_Location", "",
            "event type", "event type",
            "lat", Transactions[Lat],
            "long", Transactions[Long],
            "userid", RELATED ( Users[Id] ),
            "locationid", RELATED ( Locations[Id] )
        ),
        SELECTCOLUMNS (
            FILTER ( Tracker, Tracker[Event type] = "Register" ),
            "Table", "Register",
            "Created on", Tracker[Created On ],
            "Created on_Location", "",
            "event type", Tracker[Event type],
            "lat", Tracker[Lat],
            "long", Tracker[Long],
            "userid", RELATED ( Users[Id] ),
            "locationid", ""
        )
    )