Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

When using the Timestampdiff result is attribute- How to turn into metric?

Received Response
191
Views
3
Comments

Summary

The result of a calculation in DV with TImestampdiff the result is an Attribute. Can't be swiched to Measure.

Content

When creating a calculation to calculate e.g. the current age of a person by using:

TIMESTAMPDIFF(SQL_TSI_YEAR, XSA('weblogic'.'Workforce Management - Worker Assignment Real Time')."Columns"."Person Date of Birth", CURRENT_DATE)

the result is marked as Attribute. When using the 'treat as' the symbol to the calculation is not changing from A to #. The problem then is when you want to drag the calculated item into the '# Values' section of a visualization it is not allowed.

Any suggestions to work around that?

 

Version

105.3

Tagged:

Answers

  • User10137270-Oracle
    User10137270-Oracle Rank 2 - Community Beginner

    Some further test done.

    Using the the same calculation as part of a dataflow allows to mark the result as measure.

  • Hello Wilbert, to have it show as a measure you need to explicitly set an aggregation rule in the calc. Typically Avg in this case, but could be anything else

    See the picture below with the formula. In this case, the object shows as a metric. You need to be aware of the level of details you bring in your viz, as OAC will aggregate the calc with that rule for the detail grain you have in your query. Let me know if not what you needed

    thanks

    Philippe

    avg.png

  • User10137270-Oracle
    User10137270-Oracle Rank 2 - Community Beginner

    Thanks philippe