Now we need to make sure that all of our tables are properly related: The code to create the new table is below: To do that, make sure you are in the Report view then click on Modeling->New Table. The next step is to create the Market Basket table. ![]() Sales = Sales * RELATED ( ‘Product' )Ĭost = Sales * RELATED ( ‘Product' ) ![]() While we are in the Sales table, we can add Sales, Cost, Margin and Margin% fields to it so we can do sales and margin analysis of individual products. Now our Sales table will look like the image below (please note that records with the same Transaction ID have the same value for the Market Basket) The code to add the Market Basket field to the Sales table is below: We will identify a market basket as a string of all Product IDs in that basket separated by “-” character. To do that, we need to create a new field on the Sales table. The first order of business is to assign our sales transactions into Market Baskets. ![]() Sales = EARLIER(Sales)Īfter we have the two tables loaded and related by Product ID, we can start enhancing the model.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |