I’m hitting problem that calculate the calculated field and the non-calculated field.
I want to calculate cpa of advertisement.
So i made the below formula.
Hello @yuuyake9191, welcome to the QuickSight community!
There are a couple of options to make a calculation like this work. What kind of visuals are you implementing the field on? If it is on a table that will partition the returned values how you are wanting, then we can try something like this:
Another option would be to aggregate the advertisement_budget field depending on how many rows you want to be accounted for. Using sum for many rows you want to add up based on user ids or min if it is a single row, we should be able to ignore the errors:
Account for many rows = sum({advertisement_budget})/count(ifelse({utm_source} = 'advertisement', {id[user]}, NULL)
Account for one row = min({advertisement_budget})/count(ifelse({utm_source} = 'advertisement', {id[user]}, NULL)
Depending on your implementation, one of these options should get you the result you are wanting. I will mark this response as the solution, but please let me know if you have any remaining questions. Thank you!
① the data didn’t show all on the chart.
② the data was not calculated
③ calculated field does not display as “custom”(shown total, average, count etc…)
Hello @yuuyake9191, maybe we can try switching the calculations to LAC-W fields to resolve the problem. Something that would also help me resolve this for you would be if you added a demo version of this in QuickSight Arena and linked the shared dashboard with me in your next response. That way I could test out options to find a solution.
Let’s try switching to LAC-W fields. I’ll use the date field as the partition for the calculation:
Then, when you add this to your field well, make sure you use the min aggregation on the field. That should return the value you are wanting for each month. I would recommend testing this in a table visual as well to see if the values are matching your expected values. Thank you!
Hello @yuuyake9191, can you explain what didn’t work well about my previous suggestion? Did you run into any error messages?
I would also recommend try adding some of those calculations into a table visual to see what is populating. Are you getting anywhere near your expected values?
Hello @yuuyake9191, I went through the Arena dashboard and found a few things. For the first chart you will see the calculations you created. When I set that aggregation on the field well to min, it was showing the values you expected for the first to data points.
Then, the 2nd line chart visual will show the values based on the calculation I created. The numbers seem larger than what you were expecting for some of the data points, but one of these options should provide the answer you were looking for. Let me know if you have any questions!