Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a straight table with a calculated dimension that goes:
=Sum(If(year(Today())*100+Week(Today())-1 < YEARWEEK +4, DEMANDED_QTY))
or
=If(year(Today())*100+Week(Today())-1 < YEARWEEK +4, Sum(DEMANDED_QTY))
But I get "Error in calculated dimension" in both methods
If I use
=If(year(Today())*100+Week(Today())-1 < YEARWEEK +4, DEMANDED_QTY)
The dimension works but I get one row per YEARWEEK ( I think)
I want to get the total amount demanded for the last 4 weeks on one row.
Anyone that has any ideas of what I'm doing wrong?
I tried moving the function to expressions and then it worked so I guess my problem is solved.
But I still would like to know why I can not do this as a dimension...
br
Martin
Martin,
In general, when you use aggregation in calculated dimension (sum in your case), you have to use aggr() function around it to tell what you're aggregating by. This explains the error. I cannot tell what excatly it should be in your case without knowing your data model and you want to see in the table.
I guess moving it to expression was the correct choice.
Martin,
In general, when you use aggregation in calculated dimension (sum in your case), you have to use aggr() function around it to tell what you're aggregating by. This explains the error. I cannot tell what excatly it should be in your case without knowing your data model and you want to see in the table.
I guess moving it to expression was the correct choice.