on 10-02-2016 12:32 PM
Hi All,
I am trying to create a SQL based Calculation View.I have a two queries here.
1. I want to calculate the count of employees whose BEGDA <= DATE1 where the user gives the DATE1 as input during the runtime. Used Input Parameters and placeholder to capture this as below.But still i observed that the data is coming for all the dates.i do not know where should i assign this functional check BEGDA <= DATE1
2.If i have to calculate the employee count with the conditions BEGDA <= DATE1 and DATE1 <= ENDDA along with the existing condition STAT2='3' how should i place the Place holders in the script?Will my below script work?
BEGIN
var_out = select MANDT,
PERNR,
to_Date(BEGDA,'YYYYMMDD') as BEGDA,
to_DATE(ENDDA,'YYYYMMDD') as ENDDA,
STAT2,
case when (STAT2='3' and BEGDA<= '$$DATE1$$' and ENDDA>= '$$DATE_1$$') then count(t1.PERNR) END as EMP_COUNT,
from "_SYS_BIC"."Modelling/EMPLOYEE_DETAILS_ATV" (PLACEHOLDER."$$DATE1$$" => :DATE1)
group by MANDT,
PERNR,
BEGDA,
ENDDA,
STAT2;
END
Thank You all,
DSK
Hello DSK,
as you are selecting from another view in your scripted view, the operator (e.g. <=) which is used for the filter is/must be defined in a filter expression in the view you select from. As an alternative you could use a simple where-clause. How is the DATE1 parameter used in view EMPLOYEE_DETAILS_ATV?
Your second statement will not work in that way. It has to be solved either by a filter expression in view EMPLOYEE_DETAILS_ATV or by a where clause.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.