简体   繁体   中英

calculate the percentage with sql and DOMO

I have a table where I want to calculate the percentage of revenue using the following formula: (Advertiser Revenue / Total Revenue) * 100. Data =>

Partner    Date           Ad Unit   Revenue   Total Revenue
App        1/1/2020       x         10        13
App        1/1/202        y         3         13

Here is my code and what I have tried:

SELECT ad.`Partner`,
       ad.`Date`,
       ad.`Ad Unit`,
       ad.`Revenue`,
       ad.`Total Revenue`
      (ad.`Revenue` / ad.`Total Revenue`) * 100 as `Percentage`
FROM `ad_unit_totals` as ad

Error: syntax error: execute command denied to user

In Domo, this calculation would best be done at the visualization layer using Beast Mode. Just create your beast mode that is Revenue / Total Revenue .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM