Skip to content

Instantly share code, notes, and snippets.

@ernestoongaro
Last active July 2, 2018 13:30
Show Gist options
  • Save ernestoongaro/e3907369aa54a70742b0ca5ba7305167 to your computer and use it in GitHub Desktop.
Save ernestoongaro/e3907369aa54a70742b0ca5ba7305167 to your computer and use it in GitHub Desktop.
?dynamic_fields=[{"table_calculation":"rank","label":"rank","expression":"rank(${order_items.count},${order_items.count})","value_format":null,"value_format_name":null,"_kind_hint":"measure","_type_hint":"number"},{"table_calculation":"rank_this_month","label":"rank (this month)","expression":"pivot_index(${rank},1)","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure","_type_hint":"number"},{"table_calculation":"rank_last_month","label":"rank (last month)","expression":"pivot_index(${rank},2)","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure","_type_hint":"number"},{"table_calculation":"rank_last_year","label":"rank (last year)","expression":"pivot_index(${rank},3)","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure","_type_hint":"number"},{"table_calculation":"month_over_month_change","label":"month over month change","expression":"${rank_last_month} - ${rank_this_month}","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure","_type_hint":"number"},{"table_calculation":"month_over_year_change","label":"month over year change","expression":"${rank_last_year} - ${rank_this_month}","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure","_type_hint":"number"},{"table_calculation":"movement_month","label":"movement (month)","expression":"if(${month_over_month_change} > 0,concat(\" ▲ \", ${month_over_month_change}),\n if(${month_over_month_change} < 0, concat(\" ▼ \", ${month_over_month_change}),\n \tif(${month_over_month_change} = 0, \"-\",\n \t\tnull)))","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure","_type_hint":"string"},{"table_calculation":"movement_year","label":"movement (year)","expression":"if(${month_over_year_change} > 0,concat(\" ▲ \", ${month_over_year_change}),\n if(${month_over_year_change} < 0, concat(\" ▼ \", ${month_over_year_change}),\n \tif(${month_over_year_change} = 0, \"-\",\n \t\tnull)))","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure","_type_hint":"string"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment