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

[Canned Reports] Create visualisation on question with filters #835

Open
Tracked by #834
mahalakshme opened this issue Dec 16, 2024 · 1 comment
Open
Tracked by #834

[Canned Reports] Create visualisation on question with filters #835

mahalakshme opened this issue Dec 16, 2024 · 1 comment
Assignees

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Dec 16, 2024

AC:

  • Users should be able to see count of individuals registered for each subject type in the form of bar chart. Do not include the voided individuals.
  • X-axis should have the name of subject type and Y-axis the count of registrations
  • Should be able to filter with start and end date which should be based on registration_date in individual table

Technical suggestions:

Metabase api link

Approximate payload that might work - Not tested:

POST /api/card
Authorization: Bearer <your_api_token>

{
  "name": "Sales Data with Date Filters",
  "dataset_query": {
    "type": "native",
    "native": {
      "query": "SELECT date, SUM(sales) AS total_sales FROM sales_table WHERE date BETWEEN {{start_date}} AND {{end_date}} GROUP BY date ORDER BY date",
      "template-tags": {
        "start_date": {
          "id": "c53df913",
          "name": "start_date",
          "display_name": "Start Date",
          "type": "date",
          "default": "2023-01-01"  // Optional default value
        },
        "end_date": {
          "id": "c82df913",
          "name": "end_date",
          "display_name": "End Date",
          "type": "date",
          "default": "2023-12-31"  // Optional default value
        }
      }
    },
    "database": 1  // Replace with your database ID
  },
  "display": "bar",  // Visualization type
  "visualization_settings": {
    "x_axis.title": "Date",
    "y_axis.title": "Total Sales",
    "graph.line_style": "solid"
  },
  "collection_id": null  // Add to a collection if needed
}

Inputs-Ignore-for analysis purpose and later reference:

  • paste the chart here
  • line chart over bar chart - intelligently - every line will be subject type
  • metabase, dataogram - ODK and metabase -> absolute, and then trend, display data below that
@mahalakshme mahalakshme converted this from a draft issue Dec 16, 2024
@mahalakshme mahalakshme moved this from In Analysis to In Analysis Review in Avni Product Dec 16, 2024
@mahalakshme mahalakshme changed the title Create visualisation on question with filters [Canned Reports] Create visualisation on question with filters Dec 16, 2024
@ombhardwajj
Copy link
Contributor

Please assign it to me @mahalakshme !

@mahalakshme mahalakshme moved this from In Analysis Review to Ready in Avni Product Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

2 participants