Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error when comparing a field with two other field values.

Hi all,

I think, i am missing something, if any one can point out the error i am doing, it will be great.

I want a calculation like this

sum({<ID_PERIOD = {">=0"}, ID_PERIOD = {"<=2078052"}>}QTE_VENDU)

I want to compare the ID_PERIOD falls between VALUE1 and VALUE2

When i enter the values directly it works.  but they are fields in table so i did these two things

sum({<ID_PERIOD = {">=P(SAIS_SEM_DEB)"}, ID_PERIOD = {"<=P(SAIS_SEM_FIN)"}>}QTE_VENDU)

sum({<ANNEE_SEMAINE=, ID_PERIOD={"'>='&P(SAIS_SEM_DEB)&'<='&P(SAIS_SEM_FIN))"}>} QTE_VENDU)

Both brings 0 Sum value.

Thanks in advance for your help.

Regards

Jegadish

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

After going through the community discussion.

I created a field with Recno() named as rec_num and then used the set analysis tool generator to solve my problem.

Sum({$<ANNEE_SEMAINE=,REC_NUM=P({1<ID_PERIOD={">=$(=P(SAIS_SEM_DEBUT_))"}>}REC_NUM), REC_NUM=P({1<ID_PERIOD={"<=$(=P(SAIS_SEM_FIN_))"}>}REC_NUM)>}QTE_VENDU)

View solution in original post

4 Replies
olivierrobin
Specialist III
Specialist III

hello

it could mean that your 2 fields do not contain the values you think

try to display them in text boxes , select the period you want and look at the values

qv_testing
Specialist II
Specialist II

Hi, 

Expressions seems to be correct, can you post some sample data..

Anonymous
Not applicable
Author

i want to calculate the quantity (QTE_VENDU) when the ID_PERIOD falls between SAIS_SEM_DEBUT and SAIS_SEM_FIN irrespective of my period selection.

i used this expression

sum({<ID_PERIOD = {">=P(SAIS_SEM_DEB)"}, ID_PERIOD = {"<=P(SAIS_SEM_FIN)"}>}QTE_VENDU)

= 0

when i use a hard value

sum({<ID_PERIOD = {">=0"}, ID_PERIOD = {"<=2078052"}>}QTE_VENDU)

It works correctly

Not able to find the error, help appreciated.

Anonymous
Not applicable
Author

After going through the community discussion.

I created a field with Recno() named as rec_num and then used the set analysis tool generator to solve my problem.

Sum({$<ANNEE_SEMAINE=,REC_NUM=P({1<ID_PERIOD={">=$(=P(SAIS_SEM_DEBUT_))"}>}REC_NUM), REC_NUM=P({1<ID_PERIOD={"<=$(=P(SAIS_SEM_FIN_))"}>}REC_NUM)>}QTE_VENDU)