Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I power metrics for single module #1904

Open
1 task done
amanr11314 opened this issue Sep 11, 2024 · 0 comments
Open
1 task done

How do I power metrics for single module #1904

amanr11314 opened this issue Sep 11, 2024 · 0 comments

Comments

@amanr11314
Copy link

amanr11314 commented Sep 11, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Version of Corteza

2023.9

Current Behavior

I have a module Lead
I have following field in this module:

name
source (specific option fields from select type field)
channel (specific option fields from select type field)
phone_number
amount
call_status (option of answered, missed if channel=‘Call’)
lead_time
appointment_status (unscheduled, scheduled, completed)
location
I have to power a dashboard with filter option of multi select location, date range (lead_time)

for selected filter I have to provide with the following chart metrics:

Lead count per source, per channel

Sum of Lead amount per source

Lead Conversion Count (appointment_status non empty) per source, per channel

Tracked Leads Count (Leads with phone_number non empty)

Call Status count per source where channel=‘Call’
i.e Answered count, Missed count

Also I have to group by bucket size from user input option of (week, month, day, year) for by grouping bucket on column lead_time :
I. Total Lead Count per bucket
II. Tracked Lead Count per bucket (Leads with phone_number non empty)
III. Total Lead Conversion count per bucket (appointment_status non empty)
IV. Total Lead production per bucket sum(amount) per bucket

  1. Currently I am only to call separate rest API for each metrics but not minimized:
    In this case I have to call report metrics API for module:
    However, this requires multiple API calls which is not feasible for frontend.

curl --location 'https://corteza-staging.remedoapp.com/api/compose/namespace/405510032080240642/module/406086487709319170/record/report?dimensions=CONCAT(source%2C%20%27-%27%2C%20medium%2C%20%27-%27%2C%20callStatus)&filter=medium%3D%27Call%27' \ --header 'accept: application/json, text/plain, */*' \ --header 'authorization: Bearer <token>'

  1. Created Reports Page using datasources but:
    I. I have to apply separate filter on loaded datasources dynamically for each metrics but I am unable to do so in API call.
    II. I have to create aggregate datasource for each section from original module datasource due to which I have no control over filters from api.

I am using this curl to fetch each element in report but unable to apply filter:
curl --location 'https://corteza-staging.remedoapp.com/api/system/reports/406772798300618754/run' \ --header 'accept: application/json, text/plain, */*' \ --header 'authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "frames": [ { "name": "407139715293184002", "source": "GROUP BY SOURCE-AMOUNT", "ref": "GROUP BY SOURCE-AMOUNT", "filter": {}, "sort": "" } ] }'

Expected Behavior

How can I power these metrics in single API call if not possible how to minimize the API calls for these metrics independent of each Section

Steps To Reproduce

No response

Environment and versions

No response

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant