turnilo icon indicating copy to clipboard operation
turnilo copied to clipboard

Create custom measures / edit measures

Open eugenelab opened this issue 6 years ago • 16 comments

As a business user I want to create and save the measures (post aggregations) I use most often.

For example, I have two measures defined in Turnilo config: clicks and impressions. I want to calculate CTR as clicks/impressions*100

At the moment I have to options:

  1. Ask a developer to change Turnilo config adding the measure.
  2. Export to CSV and continue in Excel Both are time consuming and breaking the flow.

Would be great to be able to use formulas based on Druid Post-Aggregations.

eugenelab avatar Dec 11 '18 22:12 eugenelab

Hi @eugenelab - thanks for feature request, this is on our long-term roadmap. See #184 (simple expressions for measures).

mkuthan avatar Dec 12 '18 07:12 mkuthan

I think we should start simple, with basic expressions. Post-Aggregations (plywood, we shouldn't tie ourselves to Druid) could be overwhelming to common users.

adrianmroz avatar Dec 12 '18 09:12 adrianmroz

Hi @mkuthan, thanks! @adrianmroz totally agree. Basic expressions would cover most common use cases.

eugenelab avatar Dec 12 '18 21:12 eugenelab

Hi, any news on this one?

eugenelab avatar May 22 '19 12:05 eugenelab

In 1.15 you can add arithmetic expression to measures and calculate percent of total/parent for every measure.

adrianmroz avatar May 22 '19 12:05 adrianmroz

In this dropdown list of measures we see only the measures described in attributeOverrides section of the cube: image How can we see auto-discovered measures there ?

Laboltus avatar May 08 '20 08:05 Laboltus

Aren't missing measures some kind of approximation measures? (quantiles, thet sketches ...). We show all non-approximation measures in this dropdown, because arithmetic operations on approximations would be misleading.

adrianmroz avatar May 08 '20 08:05 adrianmroz

No, there are only longSum and doubleSum

Laboltus avatar May 08 '20 08:05 Laboltus

Are those measures visible in left-side panel?

adrianmroz avatar May 08 '20 08:05 adrianmroz

Yes.

Laboltus avatar May 08 '20 08:05 Laboltus

I can't spot any issue in the code. I will try to reproduce this on my instance and see what happens. So you have config with empty measures section, few attributeOverrides and rest of the measures are discovered via inspection?

adrianmroz avatar May 08 '20 09:05 adrianmroz

Sorry for misinformation, I just noticed that attributeOverrides is empty and all measures that I see in the dropdown list are described in Measures section. All other measures are discovered via inspection.

Laboltus avatar May 08 '20 09:05 Laboltus

So let me get this straight:

  1. Few measures in measures section (let's call them defined measures). Rest of discovered via inspection (let's call them discovered measures).
  2. You see both of defined and discovered measures in left panel
  3. You see only defined measures in dropdown for Expression series

adrianmroz avatar May 08 '20 09:05 adrianmroz

Exactly.

Laboltus avatar May 08 '20 09:05 Laboltus

Sorry, I couldn't replicate your issue. I even see that objects passed to left panel and expression dropdown are the same. Only filtering is here: https://github.com/allegro/turnilo/blob/master/src/client/components/series-menu/arithmetic-series-menu.tsx#L108

Are you sure, your measures do not return true for isApproximate? https://github.com/allegro/turnilo/blob/master/src/common/models/measure/measure.ts#L184

adrianmroz avatar May 13 '20 11:05 adrianmroz

I don't sure what returns isApproximate. How can I check this ? Here is a typical ingestion spec:

{
         "type": "longSum",
         "name": "bad_actions",
         "fieldName": "bad_actions",
         "expression": null
       }

Laboltus avatar May 13 '20 13:05 Laboltus