on 08-17-2016 8:36 PM
Hi, I have got a requirement to calculate the count based on input value from user, the required 2 columns are created and posted.
Order Number | Created on | Posting date | Created | Posted |
---|---|---|---|---|
400012 | 01.12.2015 | 01.01.2016 | ? | ? |
400014 | 01.12.2015 | 01.12.2015 | ? | ? |
400015 | 01.06.2016 | 01.06.2016 | ? | ? |
user selection is Year, there is no column which stores the year data.
It is going to be an input parameter/variable given to user for input, based on the selection value, created and posted columns are to be calculated.
the calculation is, if the given user value is 2015, "Created" would be number of orders which have created on date falls in 2015. similarly for "posted" as well.
In the above example data, if user input is 2015, then Created - 2 posted - 1.
I am thinking, what is the appropriate way to achieve this, should I be able to achieve it through 'Counter' or "new calculated column" and how?
Please let me know,
Thanks
Sreekanth
One option would be the following:
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Florian, that helps to continue further. in my initial projection node table, data exists for several years. we do not want to project the all the years, but just the user input value and previous year.
how do I filter the year column in the projection node with User input Year and also the previous year value?
I am Bex developer, I used to write a customer exit program to read the data from IP1(user input), do the offset in code to add previous year also. Then customer exit input parameter is used to filter the data.
how do we do this in HANA native model? should I use stored procedure to read the IP1 value and get the previous year in the logic? if that is the case, how do I access the IP1 value in Stored procedure?
Please let me know,
To consider also the previous year you only have to adjust the filter expression and the expression of the calculated column. In the following examples the "in" function is used to compare the column against the entered year value and the calculated previous year value.
Filter expression:
in(string(component("CreatedOn",1)) ,'$$IP_YEAR$$',string(int('$$IP_YEAR$$')-1)) or in(string(component("PostingDate",1)) ,'$$IP_YEAR$$',string(int('$$IP_YEAR$$')-1))
Expression for calculated column (for instance for the CreatedOn column):
if(in(string(component("CreatedOn", 1)) ,'$$IP_YEAR$$', string(int('$$IP_YEAR$$'))-1),1,0)
Regards,
Florian
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.