Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
there is a way to specify in a formula two different calculation, based on the selection of a field?
My Column contain number 1,2,3,4,5
If I select 1 I want 2+2
if I select 2 I want the avg
To better understand:
If (Column = 1 , 2+2, avg(Column))
Thanks for any help
A tad hard to try and troubleshoot this particular formula without the actual data...
Does the formula in question return a result if you omit the if() condition?
If it does, there might be an issue with triggering the condition on the same field as your set analysis, though I don't think that's supposed to be the case. You could check by using a different field for the conditional statement.
The code you posted should work. What exactly is the problem?
The formula is a bit to complex:
if (DataPoint = 'COG / BoardStructure / BoardType',
avg(
aggr(avg({<DataPoint={"COG / GenderDiversity / Women"}>} ValueChecked), CompanyName)
/
aggr(avg({<DataPoint={"COG / BoardStructure / Board Size"}>} ValueChecked), CompanyName)
)
,0)
the results is always 0 even if I select 'COG / BoardStructure / BoardType' in the filter DataPoint
A tad hard to try and troubleshoot this particular formula without the actual data...
Does the formula in question return a result if you omit the if() condition?
If it does, there might be an issue with triggering the condition on the same field as your set analysis, though I don't think that's supposed to be the case. You could check by using a different field for the conditional statement.
Hi Man, it works.
was my mistake in the spelling of the text.
Thanks for your help