More > JRiver Media Center 33 for Windows

Expression Problem

(1/2) > >>

SkGe:
I have an issue with one expression.
To explain:
My expression search the value from 0-100, where if it finds those value it counts and then multiply by a factor.
But it seems somewhere is a bug where my expression adds an extra value. I have done some debug and search by each block of values and everything is counted correctly. But when needs to add those multiply factor, it will increase it.
Here is how my expression is composed:


--- Code: ---math(math(
math(listcount(ListGrep([aoty list score],1))*1)+
math(listcount(ListGrep([aoty list score],2))*1)+
math(listcount(ListGrep([aoty list score],3))*1)+
math(listcount(ListGrep([aoty list score],4))*1)+
math(listcount(ListGrep([aoty list score],5))*1)+
math(listcount(ListGrep([aoty list score],6))*1)+
math(listcount(ListGrep([aoty list score],7))*1)+
math(listcount(ListGrep([aoty list score],8))*1)+
math(listcount(ListGrep([aoty list score],9))*1)+
math(listcount(ListGrep([aoty list score],10))*2)+
math(listcount(ListGrep([aoty list score],11))*2)+
math(listcount(ListGrep([aoty list score],12))*2)+
math(listcount(ListGrep([aoty list score],13))*2)+
math(listcount(ListGrep([aoty list score],14))*2)+
math(listcount(ListGrep([aoty list score],15))*2)+
math(listcount(ListGrep([aoty list score],16))*2)+
math(listcount(ListGrep([aoty list score],17))*2)+
math(listcount(ListGrep([aoty list score],18))*2)+
math(listcount(ListGrep([aoty list score],19))*2)+
math(listcount(ListGrep([aoty list score],20))*4)+
math(listcount(ListGrep([aoty list score],21))*4)+
math(listcount(ListGrep([aoty list score],22))*4)+
math(listcount(ListGrep([aoty list score],23))*4)+
math(listcount(ListGrep([aoty list score],24))*4)+
math(listcount(ListGrep([aoty list score],25))*4)+
math(listcount(ListGrep([aoty list score],26))*4)+
math(listcount(ListGrep([aoty list score],27))*4)+
math(listcount(ListGrep([aoty list score],28))*4)+
math(listcount(ListGrep([aoty list score],29))*4)+
math(listcount(ListGrep([aoty list score],30))*6)+
math(listcount(ListGrep([aoty list score],31))*6)+
math(listcount(ListGrep([aoty list score],32))*6)+
math(listcount(ListGrep([aoty list score],33))*6)+
math(listcount(ListGrep([aoty list score],34))*6)+
math(listcount(ListGrep([aoty list score],35))*6)+
math(listcount(ListGrep([aoty list score],36))*6)+
math(listcount(ListGrep([aoty list score],37))*6)+
math(listcount(ListGrep([aoty list score],38))*6)+
math(listcount(ListGrep([aoty list score],39))*6)+
math(listcount(ListGrep([aoty list score],40))*8)+
math(listcount(ListGrep([aoty list score],41))*8)+
math(listcount(ListGrep([aoty list score],42))*8)+
math(listcount(ListGrep([aoty list score],43))*8)+
math(listcount(ListGrep([aoty list score],44))*8)+
math(listcount(ListGrep([aoty list score],45))*8)+
math(listcount(ListGrep([aoty list score],46))*8)+
math(listcount(ListGrep([aoty list score],47))*8)+
math(listcount(ListGrep([aoty list score],48))*8)+
math(listcount(ListGrep([aoty list score],49))*8)+
math(listcount(ListGrep([aoty list score],50))*10)+
math(listcount(ListGrep([aoty list score],51))*10)+
math(listcount(ListGrep([aoty list score],52))*10)+
math(listcount(ListGrep([aoty list score],53))*10)+
math(listcount(ListGrep([aoty list score],54))*10)+
math(listcount(ListGrep([aoty list score],55))*10)+
math(listcount(ListGrep([aoty list score],56))*10)+
math(listcount(ListGrep([aoty list score],57))*10)+
math(listcount(ListGrep([aoty list score],58))*10)+
math(listcount(ListGrep([aoty list score],59))*10)+
math(listcount(ListGrep([aoty list score],60))*12)+
math(listcount(ListGrep([aoty list score],61))*12)+
math(listcount(ListGrep([aoty list score],62))*12)+
math(listcount(ListGrep([aoty list score],63))*12)+
math(listcount(ListGrep([aoty list score],64))*12)+
math(listcount(ListGrep([aoty list score],65))*12)+
math(listcount(ListGrep([aoty list score],66))*12)+
math(listcount(ListGrep([aoty list score],67))*12)+
math(listcount(ListGrep([aoty list score],68))*12)+
math(listcount(ListGrep([aoty list score],69))*12)+
math(listcount(ListGrep([aoty list score],70))*14)+
math(listcount(ListGrep([aoty list score],71))*14)+
math(listcount(ListGrep([aoty list score],72))*14)+
math(listcount(ListGrep([aoty list score],73))*14)+
math(listcount(ListGrep([aoty list score],74))*14)+
math(listcount(ListGrep([aoty list score],75))*14)+
math(listcount(ListGrep([aoty list score],76))*14)+
math(listcount(ListGrep([aoty list score],77))*14)+
math(listcount(ListGrep([aoty list score],78))*14)+
math(listcount(ListGrep([aoty list score],79))*14)+
math(listcount(ListGrep([aoty list score],80))*16)+
math(listcount(ListGrep([aoty list score],81))*16)+
math(listcount(ListGrep([aoty list score],82))*16)+
math(listcount(ListGrep([aoty list score],83))*16)+
math(listcount(ListGrep([aoty list score],84))*16)+
math(listcount(ListGrep([aoty list score],85))*16)+
math(listcount(ListGrep([aoty list score],86))*16)+
math(listcount(ListGrep([aoty list score],87))*16)+
math(listcount(ListGrep([aoty list score],88))*16)+
math(listcount(ListGrep([aoty list score],89))*16)+
math(listcount(ListGrep([aoty list score],90))*18)+
math(listcount(ListGrep([aoty list score],91))*18)+
math(listcount(ListGrep([aoty list score],92))*18)+
math(listcount(ListGrep([aoty list score],93))*18)+
math(listcount(ListGrep([aoty list score],94))*18)+
math(listcount(ListGrep([aoty list score],95))*18)+
math(listcount(ListGrep([aoty list score],96))*18)+
math(listcount(ListGrep([aoty list score],97))*18)+
math(listcount(ListGrep([aoty list score],98))*18)+
math(listcount(ListGrep([aoty list score],99))*18)
)+
math(listcount(ListGrep([aoty list score], 100, 0))*20))
--- End code ---

Where my field has the value list from 0-100, delimited by ;

As more example:
[aoty list score] = 20;51;58;60;60;70;80;80;80;80;80;80;100;100
After checking those values, the expression should show a total of 198 on values, but instead put 218.


Matt:
I played a little and this returns 3 since the 1 is in 100 and 51:
listcount(ListGrep(20;51;58;60;60;70;80;80;80;80;80;80;100;100,1))

Are you taking that into account?

SkGe:
Does that mean each time the listgrep() will find from these values from 0-100 it will double that value? Because the only double value it comes from 51. If that can listgrep() be extended that when it founds value from a list from lets say 0-100 it will not include and double.

Matt:
Well to simplify, this:
ListGrep(20;51;58;60;60;70;80;80;80;80;80;80;100;100,1)

Returns:
51;100;100

So I think it's working like it's supposed to.  Whether that works for you is another question.

zybex:
I would also expect ListGrep() to find whole values, not substrings. Maybe a new mode is needed for that:

0   Perform a case insensitive search
1   Perform a case sensitive search
2   Perform a case insensitive search, match whole item string
3   Perform a case sensitive search, match whole item string

@SkGe, here's an alternate solution using 5 functions instead of 300 :)
listmath(listmix(max(math(int([L1]/10)*2),1), 0, [aoty list score]), 2)

Note that a zero input is also worth 1 point in this expression. That can be fixed if needed.

Navigation

[0] Message Index

[#] Next page

Go to full version