Skip to Main Content
  • Questions
  • Using a calculated column alias in concatenated column

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Rebecca.

Asked: June 10, 2020 - 4:44 pm UTC

Last updated: June 19, 2020 - 5:31 am UTC

Version: Oracle Cloud Application 20B (11.13.20.04.0)

Viewed 1000+ times

You Asked

Hello,

I'm trying to create a BI Publisher report to update Salaries using the HCM Data Loader.

I have a calculated column to populate the proposed salary depending on grade:

CASE pgf.NAME WHEN 'T4' THEN '9.00'
WHEN 'T3' THEN '9.75' 
ELSE '' END AS 'Proposed_Salary'


And I have another column that concatenates the relevant fields needed for the HCM data loader:

||cs.SALARY_ID||'|'||paam.ASSIGNMENT_NUMBER||'|'||TO_CHAR(cs.DATE_FROM, 'YYYY/MM/DD')||'|'||TO_CHAR(cs.DATE_TO, 'YYYY/MM/DD')||'|'||Proposed_Salary||'|'||cs.MULTIPLE_COMPONENTS||'|'||csbt.SALARY_BASIS_NAME||'|'||cs.SALARY_APPROVED||'|'||pab.ACTION_CODE||'|'||parb.ACTION_REASON_CODE HDL


When I add the alias from the calculated column into the concatenation I get the following error:

ORA-00904: "PROPOSED_SALARY": invalid identifier

Please can you point me in the right direction? :)




and Connor said...

Sorry, I don't know much about either BI Publisher or HCM data loader, so I'd strongly recommend you post this is their forums as well

https://community.oracle.com/community/groundbreakers/oracle-applications/e-business_suite/human-capital-management-hcm

https://community.oracle.com/community/groundbreakers/business_intelligence/business_intelligence_foundation/bi_publisher

but I am guessing that the concatenation does not have visibility to *calculated* columns, so could you possibly replicate the full case statement into the expression instead ? ie


||cs.SALARY_ID||'|'||paam.ASSIGNMENT_NUMBER||'|'||
TO_CHAR(cs.DATE_FROM, 'YYYY/MM/DD')||'|'||TO_CHAR(cs.DATE_TO, 'YYYY/MM/DD')||'|'||
CASE pgf.NAME WHEN 'T4' THEN '9.00' WHEN 'T3' THEN '9.75'  ELSE '' END
||'|'||cs.MULTIPLE_COMPONENTS||'|'||csbt.SALARY_BASIS_NAME||'|'||cs.SALARY_APPROVED||'|'||pab.ACTION_CODE||'|'||parb.ACTION_REASON_CODE HDL


Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thank you!

Rebecca, June 18, 2020 - 4:31 pm UTC

Hi Connor,

Sorry for the delayed response, this has worked perfectly! Thank you :)
Connor McDonald
June 19, 2020 - 5:31 am UTC

glad we could help

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library