sisense.com
✅ You are viewing documentation for the latest version of Compose SDK.
Version:

Function useGetNlgInsights

useGetNlgInsights(...args): UseGetNlgInsightsState

React hook that fetches an analysis of the provided query using natural language generation (NLG). Specifying a query is similar to providing parameters to a useExecuteQuery hook, using dimensions, measures, and filters.

Parameters

ParameterType
...args[UseGetNlgInsightsParams]

Returns

UseGetNlgInsightsState

Response object containing a text summary

Example

const { data, isLoading } = useGetNlgInsights({
  dataSource: 'Sample ECommerce',
  dimensions: [DM.Commerce.Date.Years],
  measures: [measureFactory.sum(DM.Commerce.Revenue)],
});

if (isLoading) {
  return <div>Loading...</div>;
}

return <p>{data}</p>;
Last Updated: