I am looking to create a calculated field to determine the percentage difference of time intervals, count of categories, and average number of products, and then utilize this calculated field in the columns within the Field Wells.
My dataset includes fields such as categories, products, time intervals(seconds), count of categories, average number of products, months, and years.
I aim to compare the time intervals, count of categories, and average number of products between the current and previous years.
I’ve reviewed the document you shared. I’m encountering an issue with the percentDifference() function where I’m not receiving any value. I’m unsure if I’m utilizing the function correctly. Additionally, I want to use this %change field in the Columns in the Field Well. Could you please provide detailed guidance on how to accomplish this?
Here’s the percentDifference() function I’m currently using:
I also have a question: Do I need to create separate calculated fields for each time interval, count of categories, and average number of products fields to calculate the percentage difference between the current year and the previous year? If so, how can I replicate something similar to the image provided above:
You can add the same measure field again and set it to show Percentage Difference table calculation with calculate as set to Group Across to get this effect.
Hi @sbaskax, I encountered a similar issue recently and found a solution that worked for me. I believe it might help you as well.
I approached it by creating two calculated fields, one for calculating the count of categories for the year 2023 and another for 2024. Then, I created another calculated field to compute the percentage difference between the two.
step 1:
Created calculated for calculating the count of categories for the year 2024
countIf(categories,years=yearparam)
yearparam is a calculated field that extracts the year from a date parameter. For example:
extract('YYYY',${Date})
step 2:
Created calculated for calculating the count of categories for the year 2023