cancel
Showing results for 
Search instead for 
Did you mean: 

[CDS] Predefined functions in where clause

former_member334716
Discoverer
0 Kudos

Hi.

I made a CDS view which contains monthly revenue.

What I want to do is to aggregate this year's revenue.

My CDS view contains FiscalYear field but I have no idea to get this year's data.

I've tried to use predefined functions in where clause to restrict FiscalYear field but it didn't be allowed.

For example,

where FiscalYear = left(TSTMP_CURRENT_UTCTIMESTAMP(), 4)

-> Random expressions are not supported in a condition.

Is it impossible to use predefined functions in CDS where clause?

I'm new to CDS, please suggest me a solution.

Accepted Solutions (0)

Answers (2)

Answers (2)

Sean_Zhang
Product and Topic Expert
Product and Topic Expert
0 Kudos

From my current knowledge, it's not allowed to use function in where clause, you have to use in normal field, e.g. by introduce a middle layer CDS, then use the calculated field from the new introduced views in your host view in where clause.

Best Regards,

Sean

former_member334716
Discoverer
0 Kudos