Skip to main content
Announcements
Happy New Year! Cheers to another year of collaboration, connections and success.
cancel
Showing results for 
Search instead for 
Did you mean: 
lost_rabbit
Contributor III
Contributor III

Using dimensions to create another dimension

I have two dimensions called  'year' and 'week' that are derived from the 'Date' Field. I want to create a new dimension called 'DataYear' which is the multiplication of the dimensions 'year' and 'week'.  But I am unable to use the dimensions in the expression editor. Only the fields show up.

So does that mean I can't use dimensions I created in the app to create another dimension?

p.s I know I can create a calculated field in the load script but I do not have access to it. So is there a way to handle this?

Thanks in advance

Labels (2)
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

maybe this:

Sum( if (Year(Date) = Max( total Year(Date) ), Sales ) )

Regards

View solution in original post

3 Replies
agigliotti
Partner - Champion
Partner - Champion

Hello @lost_rabbit ,

In the same way you created that two dimensions on Master items, you have to create a new calculated dimension in order to use it in any charts.

Ex. Calendar.Year & Calendar.Week

You can't use a master dimension in the chart expression editor.

Best Regards

Andrea

lost_rabbit
Contributor III
Contributor III
Author

Say for eg. I want to calculate sum(Sales) for the recent year. If I had a field 'Year' in my data, I would use a set expression like this. 

Sum({<Year = {'$(=Max(Year))'}>}Sales)


But now I do not have a Year field in my data. I only have a Date field and I created 'Year' as a dimension using the formula YEAR(DATE). How would I write my formula to calculate the sum of sales for the recent year?

I tried this, but it didn't workout

=Sum ({<[Year(DATE)]={$(=max(Year(DATE)))}>} Sales)

agigliotti
Partner - Champion
Partner - Champion

maybe this:

Sum( if (Year(Date) = Max( total Year(Date) ), Sales ) )

Regards