09-09-2011 02:02 AM
Hi All,
For example I may have a channel which is 1000000 elements long in which there are 5 occurrences where where the threshold exceeds the target. I'm currently solving it like this:
Count = 0
For Length_Counter = 1 To ChnPropValGet("[1]/MyChannel", "length")
Cur_Val = CHV(Length_Counter,"[1]/MyChannel")
If Cur_Val >= Threshold Then
Count = Count + 1
End If
Next
Obviously if the length of the channel is very large this method can take a considerable amount of time to compute an answer. Does anybody know of a more efficient method to achieve the same result? I was hoping that DIAdem would have contained a built in function which I could use but I have yet to find it.
Thanks a lot for looking and I look forward to any responses.
Matthew
09-09-2011 03:40 AM
Ok, In case anybody is interested my new solution to this problem is as follows:
Call Calculate("Ch(""[1]/TempMyChannel"") = Ch(""[1]/TempMyChannel"") + CTNV(Ch(""[1]/TempMyChannel"")<5)")
Call ChnNovHandle("[1]/TempMyChannel","[1]/TempMyChannel","Delete","X",1,1,0)
Count = ChnPropValGet("[1]/TempMyChannel", "length")
Data.Root.ChannelGroups(1).Channels.Remove("TempMyChannel")
09-09-2011 03:43 AM
Should be:
Call Calculate("Ch(""[1]/TempMyChannel"") = Ch(""[1]/MyChannel"") + CTNV(Ch(""[1]/MyChannel"")<5)")
Call ChnNovHandle("[1]/TempMyChannel","[1]/MyChannel","Delete","X",1,1,0)
Count = ChnPropValGet("[1]/TempMyChannel", "length")
Data.Root.ChannelGroups(1).Channels.Remove("TempMyChannel")