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|
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
i used like this but its not working properly.
If(Item_no<>peek(Item_no) and Item_Id<>peek(Item_Id) and Date<>peek(Date),Value,Peek(Value)) as Value,
I need to generate the value filed like value 2 field.
your script is working fine here, the Peek works fine, it will always gives you the ELSE part which is the Peek(Value) because the condition is never met, Item No is always the same on the table you gave
I really can't tell you how to calculate your field..
but the only peek that make sense here is the Peek(Date), because there are some Dates presents on differents lines for different Item_id's.
But the question is how did you calculate the values present on the VALUE2 column ??
Maybe something like the below
Itemid, Date, Value , if(Peek(Itemid)=Itemid and Value=0, Peek(Value),Value) as Values
order by ItemNo,Itemid,Date
Itemid, Date, Value , if(Peek(Itemid)=Itemid and Values=0, Peek(Valuesfinal),Values) as Valuesfinal
order by ItemNo,Itemid,Date desc
DROP Table A,A1 ;