on 11-03-2014 8:56 PM
Hello,
I have a requirement where I need a custom column in Universe. Basically I have five column and need a sixth column which gives me value from 0 to 23 based on the previous five columns
[Plant] [Equipment] [ Method] [ Media][ Time Begin] [ Custom field]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 00:00:00] [1]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 00:00:00] [2]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 00:00:00] [3]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 00:00:00] [4]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 00:00:00] [5]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 00:00:00] [..]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 00:00:00] [23]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 01:00:00] [1]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 01:00:00] [2]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 01:00:00] [3]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 01:00:00] [4]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 01:00:00] [5]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 01:00:00] [..]
[1014] [ACL] [ Hourly] [AIR] [2014-02-13 01:00:00] [23]
Basically data is same in all the columns for first 23 readings. In 24th reading data changes in [Time Begin] column..in that case the Custom field should start from [1].
Any suggestions?
If you are using oracle as backend database then use the
ROW_NUMBER() OVER (PARTITION BY Time Begin ORDER BY Plant) AS Custom field
Concept should same for other databases too.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.