Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am facing a problem in script level.
Which is i need to create auto generate value using script.
my example is
Item No | Item id | Date | Value | value2 |
---|---|---|---|---|
2013 | 101 | 01/01/2017 | 0 | 100 |
2013 | 101 | 02/01/2017 | 0 | 100 |
2013 | 101 | 03/01/2017 | 100 | 100 |
2013 | 101 | 04/01/2017 | 0 | 100 |
2013 | 101 | 05/01/2017 | 90 | 90 |
2013 | 101 | 06/01/2017 | 0 | 90 |
2013 | 102 | 01/01/2017 | 0 | 200 |
2013 | 102 | 02/01/2017 | 200 | 200 |
2013 | 102 | 03/01/2017 | 0 | 200 |
2013 | 102 | 04/01/2017 | 170 | 170 |
2013 | 102 | 05/01/2017 | 0 | 170 |
please see my table i have 3 dimension which is item no , item id and date,
and also a measure which name is value i need like value2 measure using script.
If you have any solution then please suggest me.
Thanks and regards
Swarnendu
Attachment is restriced in my environment but here is the script
Script:
A:
LOAD * INLINE [
ItemNo, Itemid, Date, Value, value2
2013, 101, 01/01/2017, 0, 100
2013, 101, 02/01/2017, 0, 100
2013, 101, 03/01/2017, 100, 100
2013, 101, 04/01/2017, 0, 100
2013, 101, 05/01/2017, 90, 90
2013, 101, 06/01/2017, 0, 90
2013, 102, 01/01/2017, 0, 200
2013, 102, 02/01/2017, 200, 200
2013, 102, 03/01/2017, 0, 200
2013, 102, 04/01/2017, 170, 170
2013, 102, 05/01/2017, 0, 170
];
A1:
load
ItemNo,
Itemid, Date, Value , if(Peek(Itemid)=Itemid and Value=0, Peek(Value),Value) as Values
Resident A
order by ItemNo,Itemid,Date
;
A2:
load
ItemNo,
Itemid, Date, Value , if(Peek(Itemid)=Itemid and Values=0, Peek(Valuesfinal),Values) as Valuesfinal
Resident A1
order by ItemNo,Itemid,Date desc
;
DROP Table A,A1 ;
Front End:
Hello brother please look at this discussion hope you can help me.