Hi all, I'm new with GD and I need to create and ...
# gd-beginners
l
Hi all, I'm new with GD and I need to create and Attribute based in a Metric as this: SELECT CASE WHEN {metric/globalincentive}= 1 THEN "100%" WHEN {metric/globalincentive} >= 0.9 THEN ">=90% & <100%" WHEN {metric/globalincentive} >= 0.75 THEN ">=75% & <90%" ELSE "<=75%" END but I don't see a way to do it in GD Cloud, as it doesn't allow me to use a Metrics as an Attribute and I can't create new Attribute using MSQL, how could I do this?
i
Hi Luis, I understand that you'd like to create some "computed attribute" here. Unfortunately, this functionality is not available under the GD Cloud yet. However, I'd be more than happy to submit a product feedback on your behalf. Are there any other details that you can share with me, please? For e.g., would you like to use such attribute as a filter as well?
l
Hi Ivana, thanks for your support. It would certainly be a good option to also use computed attributes as filters or as parameters.
1
i
Thank you for the confirmation, I'll go ahead and pass your feedback to our Product team. Hopefully they'll put this feature on the roadmap.
m
Hi Luis, in the meantime, if your logic is based on the raw (unaggregated) data (i.e. a fact column in your table), you can create such attribute using the “SQL Dataset”. Remap the dataset to SQL query and add your SQL code to define the additional column/attribute i.e. like this:
Copy code
SELECT *, 
CASE 
  WHEN globalincentive = 1 THEN '100%' 
  WHEN globalincentive >= 0.9 THEN '>=90% & <100%'
  WHEN globalincentive >=0.75 THEN '>=75% & <90%'
  ELSE '<=75%'
END as x
FROM yourtable
🙌 1
p
🎉 New note created.
l
Thanks Michal, but the option to create SQL Dataset is only available in GD Cloud using a database as source, but in my case it's only possible to use a file as a data source. Finally, I'm doing this in KNIME