Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hey everyone i am trying to set an if condition but for some reason it dosen't work:
if sum({$<YEAR={'$(=max(YEAR-1))'}>}RIV_QUANT)>0 and
sum({$<YEAR={'$(=max(YEAR-1))'}>}NIS_TOTPRICE)>0 and
(sum ({$<Year={'YEAR'}>}RIV_QUANT))<1 and
(sum ({$<Year={'YEAR'}>}NIS_TOTPRICE))<1,(sum ({$<Year={'YEAR'}>}NIS_TOTPRICE))
RIV_QUANT=quantatiy
NIS_TOTPRICE=sales
Hey everyone ,
the script line that finaliy work was:
if (
sum({$<YEAR={'$(=max(YEAR)-1)'}>}RIV_QUANT)>0
and sum({$<YEAR={'$(=max(YEAR)-1)'}>}NIS_TOTPRICE)>0
and sum ({$<YEAR={'$(=max(YEAR))'}>}RIV_QUANT)<1
and sum ({$<YEAR={'$(=max(YEAR))'}>}NIS_TOTPRICE)<1,
sum ({$<YEAR={'$(=max(YEAR))'}>}NIS_TOTPRICE),sum ({$<YEAR={'$(YEAR)'}>}NIS_TOTPRICE)
)
thank you all for helping!!
here is a link to the original file:
I don't know if this is just a typo when you were posting it here, or if this is something you missed in your original expression, but you are missing a parenthesis and two extra parenthesis in your expression:
=If(Sum({$<YEAR={'$(=Max(YEAR-1))'}>} RIV_QUANT) > 0 and
Sum({$<YEAR={'$(=Max(YEAR-1))'}>} NIS_TOTPRICE) > 0 and
Sum ({$<Year={'YEAR'}>} RIV_QUANT)) < 1 and
Sum ({$<Year={'YEAR'}>} NIS_TOTPRICE)) < 1,
Sum ({$<Year={'YEAR'}>} NIS_TOTPRICE))
Hey sunny i do understand what your saying but for some reason it's not working,
can't you try using my link to find out the problem?
Hi,
Not sure If I have understood what you want to do maybe you can try this expression :
if (sum({$<YEAR={'$(=max(YEAR)-1)'}>}RIV_QUANT)>0 and sum({$<YEAR={'$(=max(YEAR)-1)'}>}NIS_TOTPRICE)>0 and sum ({$<YEAR={'$(=max(YEAR))'}>}RIV_QUANT)<0 and sum ({$<YEAR={'$(=max(YEAR))'}>}NIS_TOTPRICE)<0,sum ({$<YEAR={'$(=max(YEAR))'}>}NIS_TOTPRICE),0)
This works if you select a YEAR and if not it is taken the MAX (YEAR)
Regards
Gilles
what i am trying to show its which customers had sales on 2014 ( for example) but stopped buying in 2015 ( for example)
for some reason the reason you gave me didn't work
Hi,
If you want those that did not buy anything you should put <=0 instead of <0 for the current year. Also It works for me as I put Customer as dimension. if you want to use it in a graph without Customer as Dimension you need to do an aggr expression.
Can you tell me more how you want to use it ? Maybe in you qvf add a new sheet (in english please) with what you are trying to do ?
Regards
Gilles
Hi Jhonatan,
Are you using this in the script or as an expression of a measure?
Hey everyone ,
the script line that finaliy work was:
if (
sum({$<YEAR={'$(=max(YEAR)-1)'}>}RIV_QUANT)>0
and sum({$<YEAR={'$(=max(YEAR)-1)'}>}NIS_TOTPRICE)>0
and sum ({$<YEAR={'$(=max(YEAR))'}>}RIV_QUANT)<1
and sum ({$<YEAR={'$(=max(YEAR))'}>}NIS_TOTPRICE)<1,
sum ({$<YEAR={'$(=max(YEAR))'}>}NIS_TOTPRICE),sum ({$<YEAR={'$(YEAR)'}>}NIS_TOTPRICE)
)
thank you all for helping!!