Skip to main content
Solved

AVG and avg not working

  • July 21, 2023
  • 5 replies
  • 89 views

Forum|alt.badge.img+2

Hi guys,

 

I'm doing the dq foundation course and I'm stuck.

I have tried to look it up, but no result.

This is on an environment in the portal.

When I'm doing, with AVG or avg, this:

It says:

How do I make this work?

 

Kind regards,

Marcel

Best answer by DannyRyan

Hi @Marcel 

There are a few requirements for the creation of the DQ Evaluation Rule for Validation with Rule Logic of ‘Aggregation Rule’.

If you are able to work through the following checks, I am confident that we get get your Aggregation Rule working.

 

  1. Check the Inputs Columns

CUSTOMERNUMBER is LONG data type

CREDITLIMIT is FLOAT data type

  1. Set the Rule Logic to Aggregration rule
  2. Leave the Group By blank/empty
  3. Set the Rule Builder to Advanced Expression
  4. Finally set the when expression to 
    CREDITLIMIT > 1.1 * AVG(CREDITLIMIT)

 

The error should disappear and you will be able to continue with configuring the DQ Evaluation rule.

Please let us know how you get on.

 

5 replies

Forum|alt.badge.img+1

Hi @Marcel! Welcome to the community and thank you for posting 🙂

May I ask if you have visited our documentation portal? You can check out our help center article that explains the different uses of “avg” expression, please let me know if this helps!🙋‍♀️


Forum|alt.badge.img+2
  • Author
  • Data Voyager
  • July 24, 2023

Hi @Marcel! Welcome to the community and thank you for posting 🙂

May I ask if you have visited our documentation portal? You can check out our help center article that explains the different uses of “avg” expression, please let me know if this helps!🙋‍♀️

Hi Cansu,

Thank you for your reply.

I have checked this page and this seems to be what I'm doing.

CREDITLIMIT is a float, so it is numeric.
Imho, it should work.


Forum|alt.badge.img+1

Hi @Marcel, we’ve checked on our end and it looks functional, I’ll PM you to get more details on this.


DannyRyan
Ataccamer
Forum|alt.badge.img+2
  • Head of Technical Training
  • Answer
  • July 26, 2023

Hi @Marcel 

There are a few requirements for the creation of the DQ Evaluation Rule for Validation with Rule Logic of ‘Aggregation Rule’.

If you are able to work through the following checks, I am confident that we get get your Aggregation Rule working.

 

  1. Check the Inputs Columns

CUSTOMERNUMBER is LONG data type

CREDITLIMIT is FLOAT data type

  1. Set the Rule Logic to Aggregration rule
  2. Leave the Group By blank/empty
  3. Set the Rule Builder to Advanced Expression
  4. Finally set the when expression to 
    CREDITLIMIT > 1.1 * AVG(CREDITLIMIT)

 

The error should disappear and you will be able to continue with configuring the DQ Evaluation rule.

Please let us know how you get on.

 


Forum|alt.badge.img+2
  • Author
  • Data Voyager
  • July 27, 2023

Hi Danny,

 

Thanks for your patience, I got it working.

I had to look set the Rule logic to Aggregation rule, but also I had to remove the expressions and make them over again.

Or was a refresh good enough?

I didn't try that.

I did run the test and it worked :)

I found that a bit slow, though.

 

Kind regards,

Marcel