-
I have two sources, Actual And Budget, with a common dimension "state', I want to merge the results of the two Queries, is this possible in Malloy, otherwise, is there a different approach see code reproducible code here https://github.com/djouallah/malloy/blob/main/GalaxySchema.malloy |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Yes. You are thinking in the dimensional artifact world of traditional reporting. In this world, you build dimensional fact tables and then join them. At Looker we invented what is often being called the "Modern Data Stack" where the data doesn't have to be transformed before it can be queried. This has two benefits
Modeling data this way radically simplifies the data modeling process. Basically, you start with a transactional table (say orders) and add all the interesting calculations you can think of against this table (revenue, gross margin, etc). Next you join in all the interesting data you can think of (product tables, user tables, product attribute tables). Because of the way Malloy works, no join can effect the base calculations so you are free to dimensionalize by anything. You now have a real time view of your entire data world. Joining in forcasts can be done by taking two queries and joining the results together. To see the value of Malloy I would first start by working with a transactional table. Malloy isn't great against a pre-dimensionalized star schema. Malloy wasn't designed to do this. The Iowa Liquor data set is an interesting place to start. https://github.com/looker-open-source/malloy/blob/main/samples/iowa/iowa.malloy If you hop on our Slack channel, we'd be glad to schedule something. We're thinking when we are further along we might start Malloy Webinars. Is that something that would be interesting? |
Beta Was this translation helpful? Give feedback.
-
Thanks "Joining in forcasts can be done by taking two queries and joining the results together." how ? |
Beta Was this translation helpful? Give feedback.
-
Queries can be joined and used in lots of ways in Malloy including join two or more query results together. Any query can be used as a source. For example: https://github.com/looker-open-source/malloy/blob/main/samples/names/names.malloy Any query can be dynamically joined into a source in a single query for example.. https://github.com/lloydtabb/malloy_examples/blob/main/imdb/movie_complex.malloy#L11 Two query or more queries can be joined to gether in
|
Beta Was this translation helpful? Give feedback.
-
@lloydtabb thanks That make sense, wish it was auto generated by the system though and not manually defined, but thanks again |
Beta Was this translation helpful? Give feedback.
Queries can be joined and used in lots of ways in Malloy including join two or more query results together.
Any query can be used as a source. For example:
https://github.com/looker-open-source/malloy/blob/main/samples/names/names.malloy
Any query can be dynamically joined into a source in a single query for example..
https://github.com/lloydtabb/malloy_examples/blob/main/imdb/movie_complex.malloy#L11
Two query or more queries can be joined to gether in