Count active people

Hi togehter,

i have a custom report that i get from personio. I want to count ne number of active users and the number of inactive users.
the output from Personio is like this:

[
    {
        "body": {
            "success": true,
            "metadata": {
                "total_elements": 63,
                "current_page": 1,
                "total_pages": 1
            },
            "offset": 0,
            "limit": 0,
            "data": [
                {
                    "type": "Report",
                    "attributes": {
                        "id": "f2abd3f1-70e2-4bc4-80e2-719812abbb00",
                        "name": "Fluctuation Rate",
                        "description": "",
                        "author_first_name": "Kay",
                        "author_last_name": "Dollt",
                        "type": "timeframe",
                        "status": "up_to_date",
                        "start_date": "2024-08-01",
                        "end_date": "2024-08-31",
                        "created_at": "2024-08-22T08:45:03Z",
                        "updated_at": "2024-08-22T08:47:21.918177Z",
                        "data_refreshed_at": "2024-08-22T08:47:22Z",
                        "columns": [
                            "first_name",
                            "last_name",
                            "dynamic_11044633",
                            "dynamic_11044636",
                            "status"
                        ],
                        "filters": [],
                        "period_type": "this_month",
                        "items": [
                            {
                                "employee_id": 14943384,
                                "attributes": [
                                    {
                                        "attribute_id": "first_name",
                                        "data_type": "TEXT",
                                        "employee_id": 14943384,
                                        "value": "Romina"
                                    },
                                    {
                                        "attribute_id": "last_name",
                                        "data_type": "TEXT",
                                        "employee_id": 14943384,
                                        "value": "Degin"
                                    },
                                    {
                                        "attribute_id": "status",
                                        "data_type": "TEXT",
                                        "employee_id": 14943384,
                                        "value": "inactive"
                                    }
                                ]
                            }
                        ],
                        "archival_status": "live",
                        "archived_at": null
                    }
                }
            ]
        },
        "headers": {
            "date": "Thu, 22 Aug 2024 09:24:39 GMT",
            "content-type": "application/json",
            "transfer-encoding": "chunked",
            "connection": "close",
            "vary": "Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding, Origin",
            "x-ratelimit-remaining": "19, 59",
            "x-ratelimit-requested-tokens": "1",
            "x-ratelimit-burst-capacity": "20",
            "x-ratelimit-replenish-rate": "5",
            "server": "nginx",
            "x-is-preview": "false",
            "x-is-shadow": "false",
            "cache-control": "no-cache, private",
            "x-ratelimit-limit": "60",
            "authorization": "Bearer papi-D0Q0eRazUThkZdWeRmni0AHP5GeBELWQeJ9Iu4FWJfLYQEl0Sj-Ye4y1yuwg2NKlNMf1Ve1YuIoWiTdgoPi5dQ",
            "x-frame-options": "DENY",
            "content-security-policy": "frame-ancestors 'none'",
            "strict-transport-security": "max-age=31536000",
            "set-cookie": [
                "personio_session=eyJpdiI6IkJubSsxTmI1OE5iSE0xbjZYQmZSd1E9PSIsInZhbHVlIjoiM1phekpvYVFnam1vcGRqYmJJQXorMndiWWh0Wk91YXlyVGRaR29HUnVvZU5EcDNZcEhmNFpwbytHL0RESkIxUFZXcU1uc0phajV3Rk1JL1VMOFgyMjV1dkIwaDBNSjVpL1VTYllrZENSRm5WYktpTzFPYStha1A2Z2RtUFY3UXIiLCJtYWMiOiJiNWQwYTg5MjE2OGZiZWNjYjFkYzg2N2UwYThkNGNiNzJmOTcxNzI1Mjg4Mjk0YzNiMjgwYzY2NGM5ODViZjgyIiwidGFnIjoiIn0%3D; expires=Thu, 22 Aug 2024 19:24:39 GMT; Max-Age=36000; path=/; domain=.personio.de; secure; httponly; samesite=lax"
            ],
            "x-xss-protection": "1; mode=block",
            "x-content-type-options": "nosniff",
            "report-to": "{\"group\":\"csp-endpoint\",\"max_age\":31536000,\"endpoints\":[{\"url\":\"/csp-reports\"}],\"include_subdomains\":true}"
        },
        "statusCode": 200
    }
]

Welcome to the Make community!

The output bundle you provided doesn’t show more than one employee, and there is no “active” or “inactive” status to match against.

Could you provide a better output bundle example, and draw red circles in the screenshot where it shows an active employee, and an inactive employee?

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

Hope this helps! Let me know if there are any further questions or issues.
Note: I see hundreds of posts, notifications, and messages daily on this forum, so if I missed your reply, please message me to look at your reply.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

thats already in my question included

Welcome to the Make community!

Yes, that is possible. You’ll need a minimum of two modules:

Screenshot_2024-08-23_000808

This is just an example. Your final solution may or may not look like this depending on your requirements.

1. Iterate employees array

Screenshot_2024-08-23_000838 (2)

2. Aggregate (Count) by status

Sample output

Screenshot_2024-08-23_000805

Hope this helps! Let me know if there are any further questions or issues.
Note: I see hundreds of posts, notifications, and messages daily on this forum, so if I missed your reply, please message me to look at your reply.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

ok, that worked… i found out i have to filter some things.

In this Iterator i have to filter if this:
image
is les than 1 Month.
Than i can count how many people have gone this month.

Here is the Output of the iterator:

[
    {
        "employee_id": 14943390,
        "attributes": [
            {
                "attribute_id": "first_name",
                "data_type": "TEXT",
                "employee_id": 14943390,
                "value": "Nina"
            },
            {
                "attribute_id": "last_name",
                "data_type": "TEXT",
                "employee_id": 14943390,
                "value": "Mustermann"
            },
            {
                "attribute_id": "status",
                "data_type": "TEXT",
                "employee_id": 14943390,
                "value": "inactive"
            },
            {
                "attribute_id": "dynamic_11044633",
                "data_type": "DATE",
                "employee_id": 14943390,
                "value": "2024-06-24"
            },
            {
                "attribute_id": "dynamic_11044636",
                "data_type": "OPTION",
                "employee_id": 14943390,
                "value": "Arbeitnehmerseitig"
            }
        ],
        "__IMTINDEX__": 1,
        "__IMTLENGTH__": 2
    },
    {
        "employee_id": 19107872,
        "attributes": [
            {
                "attribute_id": "first_name",
                "data_type": "TEXT",
                "employee_id": 19107872,
                "value": "Julian"
            },
            {
                "attribute_id": "last_name",
                "data_type": "TEXT",
                "employee_id": 19107872,
                "value": "Mustermann"
            },
            {
                "attribute_id": "status",
                "data_type": "TEXT",
                "employee_id": 19107872,
                "value": "inactive"
            },
            {
                "attribute_id": "dynamic_11044633",
                "data_type": "DATE",
                "employee_id": 19107872,
                "value": "2024-04-22"
            },
            {
                "attribute_id": "dynamic_11044636",
                "data_type": "OPTION",
                "employee_id": 19107872,
                "value": "Arbeitnehmerseitig"
            }
        ],
        "__IMTINDEX__": 2,
        "__IMTLENGTH__": 2
    }
]

No problem, glad I could help!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

should i put in a new question, or do you have an idea?