Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi , I have a requirement from the user
for a chart that compares the selected year vs the previous year data.
When it selects 2020 it should not compare with the previous year, since there is no data present for 2019 in the database.(only 3 years data present everytime in the database).
So , in the chart title it should display only "WSH Incidents (2020)" instead of (WSH incidents(2019 vs 2020).
(the highlighted yellow should not be displayed when selecting 2020)
where as if 2021 or 2022 is selected it should compare with the previous years and also should be seen in the title.
Currently the expression that I use is
='WSH Incidents by Month ('& year(max([8_Year_of_incident]-1)) & ' vs ' & max([8_Year_of_incident]) & ')'
I was unsuccessful in re-writing the expression. Could help?thanks.
Hi,
You can use an IF condition.
If(
// if the selected year is equal to the smallest year
year(max([8_Year_of_incident]))=year(min({1} [8_Year_of_incident])),
// then only the selected date is displayed
'WSH Incidents by Month (' & max([8_Year_of_incident]) & ')',
// else both dates are displayed
'WSH Incidents by Month ('& year(max([8_Year_of_incident]-1))
& ' vs ' & max([8_Year_of_incident]) & ')'
)
Hi,
You can use an IF condition.
If(
// if the selected year is equal to the smallest year
year(max([8_Year_of_incident]))=year(min({1} [8_Year_of_incident])),
// then only the selected date is displayed
'WSH Incidents by Month (' & max([8_Year_of_incident]) & ')',
// else both dates are displayed
'WSH Incidents by Month ('& year(max([8_Year_of_incident]-1))
& ' vs ' & max([8_Year_of_incident]) & ')'
)