Solved

Can you create an attribute based on the value of another attribute

  • 22 February 2023
  • 2 replies
  • 119 views

Does anyone know if there’s a way of creating an Attribute based on the value of another attribute, or does this need to be created prior to hitting the GoodData platform? The "Calculated Attributes" won't fit this use-case. My use-case is, I have an Employee Table which contains an "Age" column. I'd like to assign an additional Attribute to each employee called "Age Bracket" and depending on the value in Age, would determine whether the "Age Bracket" value is Gen-X, Gen-Y, Gen-Z, or Baby Boomer. I know I can create metrics for each of those and count the unique employees, but the outcome I'm trying to achieve is a table view which shows for each Age Bracket: Count of employees, Average Salary, Average Tenure, etc. Like attached.

Based on this previous article I’m assuming it can’t be done, but hoping something might have changed since this was listed over 1 year ago.

 

Thanks

icon

Best answer by Moises Morales 22 February 2023, 15:23

View original

2 replies

Userlevel 3

Hi Mark, 

 

I’m afraid that creating a whole new attribute in the platform is not supported as it is out of the scope of the solution. It would need to be preloaded from your source data, however, there is a potential workaround that I can suggest, by using the CASE statement and Number Formatting you can define how the data returned from a preconditioned metric would look like in the insight. For example: 

 

SELECT CASE WHEN (SELECT Order Amount BY Campaign Name) <= 391018 THEN 1 ELSE 0 END

And then applying number formatting: 

 

[=1] Exceeded Expectations;
[=0] It Could improve;

You can get the results below: 

 

By the example above, defining a metric like this will depend on which fact you will use to determine the age bracket of your employees. 

 

-Moises

 

 

Thanks Moises, appreciate you taking the time and for the clever workaround.  I think I could definitely use the logic in future.  I was hoping to get a new attribute so I could use it as a Row header, but like you said, it can be done in the Source data.

 

Thanks again

Reply