The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
[SOLVED] Beginner | Group by generated Attribute
PeterParker
Member Posts: 3 Contributor I
Hi Guys,
I think its an really simple solution, but I dont get it.
This is my process:
1. Generate Sales Data
2. Joining City names with store ids
3. Generate Attributes:
a) total_price = amount*single_price
b) year = date_get(date,DATE_UNIT_YEAR)
4. Select the attributes I need.
Result:
Now I would like the to plot the data and group by different attributes to sum the total_price.
For city and category it works greate:
But if I group by year, i don´t geht any bars.
Where´s the problem?
Thanks and regards,
Peter
I think its an really simple solution, but I dont get it.
This is my process:
1. Generate Sales Data
2. Joining City names with store ids
3. Generate Attributes:
a) total_price = amount*single_price
b) year = date_get(date,DATE_UNIT_YEAR)
4. Select the attributes I need.
Result:
Now I would like the to plot the data and group by different attributes to sum the total_price.
For city and category it works greate:
But if I group by year, i don´t geht any bars.
Where´s the problem?
Thanks and regards,
Peter
0
Answers
I think the problem is that date_get() is returning a real value, which the bar plotter isn't happy about. Try converting it to a polynominal with the Numerical to Polynominal operator.
Regards,
Russ
Unfortunately thats not the solution. I can´t even select my year attribute to transform it with the "Numerical to Polynominal" operator.
I see what you mean - the problem is that the Generate Attributes Operator isn't setting the metadata for your year field to real or integer, but is "unknown" (give or take a spelling mistake in the UI!). This means it doesn't appear in the dropdown list for the Numerical to Polynominal Operator. If you type "year" into the attribute name field in the N2P Operator then it will work. As a bonus tip, if you sort by date prior to generating the new attribute you will find that the years are displayed in the correct order on the bar chart.
Regards,
Russ
It works!
Cheers,
Russ