Solved

Help with Previous year calculation

  • 12 April 2021
  • 4 replies
  • 148 views

Hello,

 

I am trying to create a calculation to show the variance between the select time period (based on the dashboard filter) and the previous year.  It looks like I need to use the previous function - but I am receiving the below error.  When I use this calculation the result is always zero

Select SalesCredit Business LineSalesCredit Business Line where Year (Billingdatekey) = Previous

 

 

 

icon

Best answer by Linda J 14 April 2021, 21:52

View original

4 replies

Userlevel 3

It looks like you are not adding the date attribute “Year” from the right-hand side menu.

 

Please see: https://help.gooddata.com/doc/enterprise/files/en/86795286/86795289/1/1554120241357/MAQL+syntax+2.png

 

You can find more information here: Get Started with Using MAQL to Write Metrics - Gooddata Free

 

And you can of course enroll to our University course for MAQL: Getting Started with MAQL (gooddata.com)

 

Let us know how it goes :) 

Ok - when I select the Date Attribute. I am getting this result.

 

I made a change that got rid of the error - but see metric in action below.  The results are clearly incorrect.

new - SalesCredit Business LineSalesCredit Business Line for Previous(Year (Billingdatekey))without PF

 

I tried with and without the PF condition - with the same results.

New metric I am trying to create is SalesCreditBusinessLineLastYear

 

This topic can be closed as I have found I was selecting the wrong attribute in my calculation.

Reply