9

​Is it possible to generate a concatenation + a subtraction in a CDS view in a C...

 8 months ago
source link: https://answers.sap.com/questions/13952684/is-it-possible-to-generate-a-concatenation-a-subtr.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
17 minutes ago

​Is it possible to generate a concatenation + a subtraction in a CDS view in a CAP application?

4 Views Last edit 14 minutes ago 2 rev

Is it possible to generate a concatenation + a subtraction + a case on a field in a CDS view query in the data model definition of a CAP application?

I leave you my failed attempts of the formula for the IDCalendar field and a screenshot of "Invalid Metadata" when I wanted to consume that view with a list report.

view Search_FaltanteCajaResults as select from Empleados join Prestamos on Empleados.employeeID = Prestamos.employee.employeeID { CONCAT( YEAR(Prestamos.createdAt), (MONTH(Prestamos.createdAt) * 2) - CASE WHEN DAY(Prestamos.createdAt) < 16 THEN 1 ELSE 0 END ) as IDCalendario };orview Search_FaltanteCajaResults as select from Empleados join Prestamos on Empleados.employeeID = Prestamos.employee.employeeID { CONCAT( substring(Prestamos.createdAt,4), ( tostring(cast(substring(Prestamos.createdAt,5,2) as Integer) * 2) )- CASE WHEN (cast(substring(Prestamos.createdAt,7,2) as Integer)) < 16 THEN 1 ELSE 0 END) as IDCalendario : String };

image.png


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK