Hi, I would have a question regarding metrics BY s...
# gooddata-cloud
Hi, I would have a question regarding metrics BY statement, I am trying to use BY for more ids, and it behave kind of wierd, for one statement everything is working as expected by for more, I cannot find all BY statements in order to slice some metric by it: (I can only slice by FlightId) - but then if I remove them from metrics and add one by one, and also one by one I add them for slicing I can make it (last screenshot).
Could you please share more about what are you trying to achieve here (what should be the result of trying to use BY for more IDs) and how the IDs and the fact are structured in your model (i.e. if all the IDs are connected to the data_logs dataset and how - i.e. if they are in some hierarchy in the model)?
I would expect, that it would be possible to slice by all three ids in the metric - so for the metric will be break down by campaign ID, flight ID and Advertiser ID.
I see, so the issue is that when using the metric with the BY, the
disappear from the catalog? I think it might have something to do with the M:N relationships in your model. In my simplified test it happened as well but once I added the FlightID to the insight, the CampaignID and AdvertiserID appeared again. But actually with your model it should not be needed to use any
rule in your metric to slice
by these three IDs. They are all accessible from the
fact against the direction of the arrow in the LDM so the system should aggregate to the proper dimensionality according to the attributes in the insight automatically. So simple
SELECT SUM(clicks)
metric should work here. And this simplified metric does work and with it all the IDs remain in the catalog. Would this work for you? BTW there is now an option to enable “show hidden objects” feature in the catalog as described here.
👍 1
I want to calculate Campaign Costs, which are calculated as impressions_fill * CPM. Impressions fill is easy going, just sum of impressions with some filtering. CPM, is calculated as FlightFlatRate * pomer odběhnuteho - tj. Flight_days_now / Flight_days_diff (both counted from flight start and end date) and also divided by impressions sum per flight (where is used WITHOUT PARENT FILTER). I think it is maybe issue with time - because maybe for example for campaign slicing should be used campaign start/end. Not sure how to approach this easily. It currently shows in graphs correct numbers, but as I mentioned, flightID is not visible sometimes :) When removed, it shows sum numbers viz. pictures