Forum Discussion
Anonymous
4 years agoNot applicable
Calculated column - Need some advanced editor advice
Greatest community, I need to create a calculated column in my fact table. The ambition is to take the old column with values [Value] and restate to new prices, depending on which [Channel] and [Y...
- 4 years ago
Anonymous , Create a new column like
Switch(True(),
[Year] = 2022 ,[Value] ,
[Year] = 2021 && [Channel] = A, [Value] * 1.05,
[Year] = 2021 && [Channel] = B, [Value] * 0.9,// add others
[Value] //default
)
amitchandak
4 years agoSuper User
Anonymous , Create a new column like
Switch(True(),
[Year] = 2022 ,[Value] ,
[Year] = 2021 && [Channel] = A, [Value] * 1.05,
[Year] = 2021 && [Channel] = B, [Value] * 0.9,
// add others
[Value] //default
)
- Anonymous4 years agoNot applicable
Thank you Amit! This is working quite well.
Question: What is the reason we put [Value] at the end of the query?
Does it mean that it is the default value if the criteria are not met?