### Example Response: Applications Source: https://kb.pigment.com/docs/retrieve-info-metadata-api This is an example of the JSON response when retrieving a list of applications from the workspace. ```json [ { "id": "057f8f30-a9a0-4daf-becd-eadc08af93ae", "name": "My Application" }, { "id": "2ad09a12-b5b0-4fc4-bcf1-f34d7771943c", "name": "Other Application" } ] ``` -------------------------------- ### Example Response: Import Configurations Source: https://kb.pigment.com/docs/retrieve-info-metadata-api This JSON output shows an example of import configurations for a block. An empty list is returned for Table blocks. ```json [ { "id": "3e904a36-bad3-413a-9db1-204d7911be57", "name": "CSV import config" } ] ``` -------------------------------- ### Example Response: Views Source: https://kb.pigment.com/docs/retrieve-info-metadata-api This is an example of the JSON response when retrieving a list of views for a specific block. ```json [ { "id": "38bdcbd7-585e-4a81-87a5-520d9e2cc7f0", "name": "Default View", "type": "Public" }, { "id": "f2f5edd7-e693-4071-9fce-fe7f16fb4379", "name": "View 2", "type": "Public" } ] ``` -------------------------------- ### SFTP Most Recent File Example 2 Path Source: https://kb.pigment.com/docs/connect-sftp-server Another example of a path configuration for importing the most recent file, demonstrating a different folder structure. ```plaintext folderB/{{date}}-salaries.csv ``` -------------------------------- ### ACCESSRIGHTS Function Examples Source: https://kb.pigment.com/docs/accessrights-function These examples demonstrate various combinations of Read and Write parameters and their resulting access rights. Using BLANK is recommended over FALSE for better performance. ```plaintext ACCESSRIGHTS(true, true) ``` ```plaintext ACCESSRIGHTS(true, false) ``` ```plaintext ACCESSRIGHTS(blank, false ) ``` ```plaintext ACCESSRIGHTS(true, blank) ``` -------------------------------- ### Get Import Status with cURL Source: https://kb.pigment.com/docs/trigger-import-apis This cURL example demonstrates how to fetch the status of an import operation, including detailed reports, by making a GET request to the Pigment API. Ensure you replace placeholder variables with your actual API key and import ID. ```plaintext # Variables export PIGMENT_API_KEY="CHANGE ME" export IMPORT_ID="CHANGE ME" # Get status curl -X GET "https://pigment.app/api/v1/import/${IMPORT_ID}/status?includedDetailedReport=true" \ -H "Authorization: Bearer ${PIGMENT_API_KEY}" ``` -------------------------------- ### SFTP Most Recent File Example 1 Path Source: https://kb.pigment.com/docs/connect-sftp-server Example of a path configuration for importing the most recent file, specifying a folder and a date-based file name. ```plaintext folderA/{{date}}-salaries.csv ``` -------------------------------- ### Example: Adding Month Dimension with Split Allocation Source: https://kb.pigment.com/docs/add-modifier This example demonstrates adding a 'Month' dimension to a 'Country' metric and applying the 'SPLIT' allocation method for data distribution. ```pigment Country[ADD split: Month] ``` -------------------------------- ### Install Pigment Plugin for Claude Code Source: https://kb.pigment.com/docs/connect-common-mcp-clients Use these commands to install the Pigment plugin for Claude Code via the plugin marketplace. ```bash /plugin marketplace add anthropics/claude-plugins-official /plugin install pigment@claude-plugins-official ``` -------------------------------- ### FIND Function - Invalid Starting Position (Zero) Source: https://kb.pigment.com/docs/find-function Demonstrates an invalid starting position of 0 for the FIND function. This results in BLANK. ```pigment FIND("a", "abc", 0) ``` -------------------------------- ### FIND Function - Invalid Starting Position (Negative) Source: https://kb.pigment.com/docs/find-function Illustrates an invalid negative starting position (-1) for the FIND function. This returns BLANK. ```pigment FIND("a", "abc", -1) ``` -------------------------------- ### Calculate Days in Each Month from a Specific Start Date Source: https://kb.pigment.com/docs/daysinperiod-function Calculates the number of days for each month, beginning from a specified start date. ```pigment DAYSINPERIOD(Month, DATE(2020, 06, 01)) ``` -------------------------------- ### Sample Audit Logs API Query Source: https://kb.pigment.com/docs/call-audit-logs-api Example of a GET request specifying the ingestedSince parameter. ```plaintext GET https://pigment.app/api/audit/v1/events?ingestedSince=2023-11-27 ``` -------------------------------- ### Get Start of Month for a Specific Date Source: https://kb.pigment.com/docs/startofmonth-function Calculates the first day of the month for a given date. No month offset is applied. ```Pigment Formula STARTOFMONTH(DATE(1986, 11, 28)) ``` -------------------------------- ### Get Start of Next Month Source: https://kb.pigment.com/docs/startofmonth-function Uses a positive month offset to find the first day of the month following the given date. ```Pigment Formula STARTOFMONTH(DATE(1986, 1, 1), 1) ``` -------------------------------- ### Get Weekday for a Specific Date (Sunday) Source: https://kb.pigment.com/docs/weekday-function This example shows how to use the WEEKDAY function to determine that December 6th, 2020, is a Sunday, returning 0. ```pigment WEEKDAY(DATE(2020, 12, 06)) ``` -------------------------------- ### Get Start of Month with Zero Offset Source: https://kb.pigment.com/docs/startofmonth-function Explicitly sets the month offset to 0, returning the first day of the same month as the given date. ```Pigment Formula STARTOFMONTH(DATE(1989, 1, 18), 0) ``` -------------------------------- ### Backward Fill with Custom Ranking Source: https://kb.pigment.com/docs/fillforward-function Reverse the fill direction using the ON operator with RANK to fill backward. This example ranks by 'Start Date' in descending order. ```pigment FILLFORWARD('Month forecast inputs',Month ON RANK(Month.'Start Date',0,DESC)) ``` -------------------------------- ### User Guide Agent Configuration Source: https://kb.pigment.com/docs/create-custom-agents Instructions and knowledge base content for an Agent designed to assist users with application navigation and business workflows. ```markdown You are a User Guide for this Pigment application. Your role is to help users find the right Boards, understand how to use them, and follow business workflows step-by-step. When a user asks a question, always reference the relevant Board by name and guide them through the process concisely. Use the Search Board tool to locate Boards and the Documentation tool to explain Pigment features when needed. Keep your tone friendly and practical. Prioritize the Knowledge provided to you — it contains the specific workflows and Board descriptions for this application. If a question falls outside your scope, suggest the user contact their application administrator. ``` ```markdown Knowledge Board @OPEX_Budget Purpose: Enter and submit annual OPEX budget. Workflow: 1. Input annual budget by Cost Center, Expense Type, and Supplier based on prior year actuals. 2. Select a seasonality method: prior year, monthly, quarterly, or custom. 3. Add new suppliers with their seasonality pattern. 4. Make manual adjustments and add comments. 5. Submit your budget for approval. Board @Revenue_Reporting Purpose: Monitor revenue performance against plan. Key Metrics: @Total_Revenue, @Revenue_by_Region, @ARR, @Net_Revenue_Retention. Use this Board to track monthly actuals vs. forecast and identify variances. Glossary - Cost Center: An organizational unit to which costs are allocated. - Seasonality: The method used to spread an annual budget across months. - Version: A distinct planning scenario (e.g., Budget, Forecast, Actuals). ``` -------------------------------- ### Get Start of Previous Month with Negative Offset Source: https://kb.pigment.com/docs/startofmonth-function Uses a negative month offset to find the first day of a month preceding the given date. ```Pigment Formula STARTOFMONTH(DATE(1986, 1, 1), -10) ``` -------------------------------- ### Add Pigment MCP Server in Gemini CLI Source: https://kb.pigment.com/docs/connect-common-mcp-clients Connect to Pigment's MCP Server using the Gemini CLI. Replace the placeholder URL with your specific MCP URL. ```bash gemini mcp add --transport http pigment https://pigment.app/api/mcp/public/{id} ``` -------------------------------- ### Extract Year from a Specific Date Source: https://kb.pigment.com/docs/year-function Use the YEAR function to get the year from a specific date. This example shows how to extract the year 2020 from December 2nd, 2020. ```pigment YEAR(DATE(2020, 12, 02)) ``` -------------------------------- ### INPERIOD Function Syntax and Usage Source: https://kb.pigment.com/docs/inperiod-function Demonstrates the syntax, arguments, return values, and an example of the INPERIOD function. ```APIDOC ## INPERIOD Function ### Description Returns `True` if a given Date is included in a time period. ### Syntax `INPERIOD(Date, Time Dimension)` ### Arguments #### Required Arguments - **Date** (Date) - Date to compare. Must be in the same Dimension as *Time Dimension*. - **Time Dimension** (Dimension) - Must be a Time Dimension based on the Calendar settings. The available options are: Day, Week, Month, Quarter, Half or Year. ### Returns - **Boolean** (Dimension: *Time Dimension*) - `TRUE` if a Date is included in the time period. `BLANK` if a Date is not included in the time period. ### Example ``` INPERIOD('Product'.'Expiration Date'[add: Month], 'Month') ``` This formula returns `TRUE` on the Month for which the Product Expiration Date falls, and `BLANK` otherwise. ``` -------------------------------- ### Get Weekday for a Specific Date Source: https://kb.pigment.com/docs/weekday-function This example demonstrates how to use the WEEKDAY function with the DATE function to find the day of the week for December 2nd, 2020. The result is 3, indicating Wednesday. ```pigment WEEKDAY(DATE(2020, 12, 02)) ``` -------------------------------- ### Sample cURL Query for Audit Logs Source: https://kb.pigment.com/docs/call-audit-logs-api Example cURL command including the authorization header. ```bash curl -X GET 'https://pigment.app/api/audit/v1/events?ingestedSince=2023-11-27' \ -H 'authorization: Bearer XXXX' ``` -------------------------------- ### Extract Day from Date using DAY Function Source: https://kb.pigment.com/docs/day-function Use the DAY function to extract the day component from a specific date. This example demonstrates how to get the day from December 2nd, 2020. ```pigment DAY(DATE(2020, 12, 02)) ``` -------------------------------- ### MIN Function with Dates Source: https://kb.pigment.com/docs/min-function-numeric Use the MIN function to find the earliest date between a metric and a specific date. This example returns the earlier date between the 'Start Date' metric and January 1st, 2023. ```Pigment Formula Max('Start Date',DATE(2023,1,1)) ``` -------------------------------- ### AND Function Examples Source: https://kb.pigment.com/docs/and-function Illustrates various scenarios of the AND function's behavior with different inputs, including TRUE, FALSE, and BLANK values. ```plaintext x > 1000 AND y > 1000 ``` ```plaintext TRUE AND TRUE ``` ```plaintext TRUE AND FALSE ``` ```plaintext True AND Blank ``` ```plaintext Blank AND FALSE ``` ```plaintext Blank AND TRUE ``` -------------------------------- ### Example Response: Blocks Source: https://kb.pigment.com/docs/retrieve-info-metadata-api This JSON structure represents the list of Blocks returned for a given Application ID. ```json [ { "id": "312c1741-b762-481f-85c2-19ebe91a348a", "name": "Revenue per Country", "type": "Metric" }, { "id": "adeb3492-3fed-48be-949e-683754f10777", "name": "Country", "type": "DimensionList" }, { "id": "cbd6404e-0683-403f-bad8-62b520bacc49", "name": "Sales Transactions", "type": "TransactionList" }, { "id": "d963374a-8363-47bb-9cbf-714f2e6f93db", "name": "Exec Reporting", "type": "Table" } ] ``` -------------------------------- ### Get SFTP Server SSH Host Key Fingerprint (Local) Source: https://kb.pigment.com/docs/connect-sftp-server Obtain the SSH host key fingerprint of the SFTP server directly from the server using this command. The fingerprint is required for secure connection setup in Pigment. ```bash ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key ``` -------------------------------- ### TRIM Function Examples Source: https://kb.pigment.com/docs/trim-function Demonstrates the usage of the TRIM function to remove leading, trailing, and extra spaces within text strings. ```pigment TRIM(" text") ``` ```pigment TRIM("text ") ``` ```pigment TRIM("this is a sentence") ``` ```pigment TRIM(" this is a longer sentence ") ``` -------------------------------- ### PRORATA with Month Dimension and Start Date Source: https://kb.pigment.com/docs/prorata-function Calculates prorata for each month, starting from a specified date. Periods before the start date will be blank. ```pigment PRORATA(month, DATE(2020,6,1)) ``` -------------------------------- ### MINOF with Employee Start Date Source: https://kb.pigment.com/docs/minof-function Returns the earliest start date from the Employee dimension block. Ensure 'Employee' is a Dimension List and 'Start date' is a Date type. ```pigment MINOF(Employee.'Start date') ``` -------------------------------- ### PROPER Function Examples Source: https://kb.pigment.com/docs/proper-function Demonstrates various use cases of the PROPER function for text capitalization and formatting. ```pigment PROPER("alan storm") ``` ```pigment PROPER("SUSAN GRAHAM, C@ss n1te, dEaN wHiTe") ``` ```pigment PROPER("this is a TITLE") ``` ```pigment PROPER("2-way street") ``` ```pigment PROPER("76BudGet") ```