Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have to convert STATLIB2 wich is a character to number within a set analysis expression.
I've tried several things like this :
=sum({$<STATLIB2={">=2010"}>} STATVAL)
=sum({$<"$(num#(STATLIB2))"={">=2010"}>} STATVAL)
Any idea ?
PS : The final expression will have to calculate too the last ten year , yead(today())-10 , with the set expression
As below, you don't need Dollar Expansion
=sum({<"=Num#(STATLIB2)"={">=2010"}>} STATVAL)
Is the STATLIB2 field always a number? If so, it would be more effective to convert it to a number in the load script. Then when working in a chart, it will already be a number.
You may also consider using an if statement rather than set analysis.
For example, sum(if(isnum(STATLIB2) and STATLIB2 >= 2010, STATVAL)) will find the sum of STATVAL values but only sums records where the two conditions are met.
Hi Gallo and thanks for help.
But STATLIB2 can be a character or a number, and I try to find the syntax with set analysis. It's more an exercice then a real problem. 😁
As below, you don't need Dollar Expansion
=sum({<"=Num#(STATLIB2)"={">=2010"}>} STATVAL)
So easy and simple ... thanks a lot Vineeth.