Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have three columns with years, number of tickets and number of calls.
Year | Tickets | Calls |
2022 | 100 | 200 |
2023 | 200 | 300 |
Now I need an expression which sums up Tickets, Calls and divides them if the year is the same as the current year. I've tried this:
if($(vYear) = $(vYearToday),sum($(vTickets))/sum($(vCalls)))
vYear is the year field, behind vYearToday is the expression year(today()) and vTickets & vCalls are above columns.
But this doesn't work and result is '-'.
Is there any other way to achieve this?
For me, both of these work:
If(Year = Year(Today()), Sum(Tickets)/Sum(Calls))
If($(vYear) = $(vYearToday), Sum($(vTickets))/Sum($(vCalls)))
My variable defintions are:
Why are you using variables instead of field names or master measures?
For me, both of these work:
If(Year = Year(Today()), Sum(Tickets)/Sum(Calls))
If($(vYear) = $(vYearToday), Sum($(vTickets))/Sum($(vCalls)))
My variable defintions are:
Why are you using variables instead of field names or master measures?
you can use Set Analysis
vYear = Max(Year)
Then
sum({<Year =, Year ='$(vYear)'>} Tickets)
/
sum({<Year =, Year ='$(vYear)'>} Calls)
then it doesn't matter with year you select it will bring the calculation for it year selected
something like this ?