[SOLVED] Beginner | Group by generated Attribute

PeterParker
PeterParker New Altair Community Member
edited November 5 in Community Q&A
Hi Guys,

I think its an really simple solution, but I dont get it.

This is my process:
image


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:
image

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:
image

But if I group by year, i don´t geht any bars.

Where´s the problem?

Thanks and regards,
Peter
Tagged:

Answers

  • swissruss
    swissruss New Altair Community Member
    Hi Peter,

    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
  • PeterParker
    PeterParker New Altair Community Member
    First of all, thank you for your reply.
    Unfortunately thats not the solution. I can´t even select my year attribute to transform it with the "Numerical to Polynominal" operator.  :(

  • swissruss
    swissruss New Altair Community Member
    Hi Peter,

    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
  • PeterParker
    PeterParker New Altair Community Member
    Thanks you swissruss.  ;)
    It works!
  • swissruss
    swissruss New Altair Community Member
    Glad it worked! Don't forget to add "[SOLVED]" to the subject so it's easy to see what's still open - helps people looking for answers and those trying to help!

    Cheers,

    Russ