Adding calculated field from analysis in custom narrative?

Hello,

I would like to create a custom narrative like:

Hello <> your capacity is <>.

Where user is a parameter ${User} and capacity is a calculated field called cal_Capacity.

The cal_Capacity has a formula of:

maxIf({capacity}, user = ${User})

When I put these two fields in the field wells, I can’t create the custom narrative.

${User} is fine, but {cal_Capacity} is not able to display and kept showing error.

What I want to achieve here is to create the above sentence based on the user selected in the filter. The capacity will change according to the user.

How can I make this narrative?

Thanks.

Hello @dixerio

Can you please try the below and let me know if this works?

The field names are according to my test dataset
a) Created a parameter customerparam for my Customer Field - this is for $User in your use-case

b) Created a Calculated field based on your Calculation:
maxif=maxIf(Quantity,Customer=${customerparam})

c) Created the Insight visual with following fields:

d) Clicked on Customize Narrative.
→ Click on Add Computation
→ Click on Computation Type as Maximum
→ Click Next
→ Under Fields - Select Date Field and For Value Select the Calculated Field

e) Now we have to frame the sentence and it looked like below:

Hello ${customerparam} your capacity is Maximum.metricValue.value


Now you can Save and test the same by changing your parameter value from Filters.

Hope this helps!

Hi,

Thanks, this solve issue with numbers. What if instead of capacity, I have a string of address instead? Can this be done in custom narrative too since it is a string and you can’t perform computation?

Hello,
Since we need to add computations, I do not think we can use String directly, for all the computation based on String, it requires a “measure” to calculate against and display the value.

Here, we have to match the user parameter with their corresponding address. We might need to consider another visual for this.