Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can anyone tell met how to use the >= operator in setanalysis?
want to find the sum of sales between to dates.
Regards,
Lambert.
Hi,
The operators have the same meaning in set analysis too..
In your case the i.e sum between two days, you will be using them in below way.
sum({<Date = {">=Start Date <= End Date"}>}Sales)
Here when you use >= and <= it will include the mentioned date, but if you use < and > then it will exclude the mentioned date.
Hope this is clear to you.
Regards,
Kaushik Solanki
Hi Lambert,
the following code calculates the sum of sales between 01 Jan 2010 to 01 Jan 2011.
sum( {<Date={">=2010-01-01 <= 2011-01-01"}>} Sales)
if you want to use variables (or fields) just replace the dates with the corresponding variables or fields.
for example, the following calculates the sum of sales between two dates stored in two variables.
sum( {<Date={">=beginDate <=endDate"}>} Sales)
Rgrds,
Abhinava
this is used for greater than or eqaual to, sometimes for excluding seleection
sum({<Date={">=$(=Max(date))"}>} -----> greater than or euals to
sum({<date>=,gm={'Anil'} amout} excluding seletion of date
on base of above you can identify beelow
>
>=
<=
<
regards
Sunil Chauhan
excellent!,
Thanks for feedback guys.
Lambert.
Hi there,
following up on this question i have a similar problem to solve:
I want to count all xDates where xDate is after yDate.
I tried it this way:
count({$<status={active}, xDate = {">=xDate >= yDate"}>} xDate)
...but it does not work. returns 0.
(xDate and yDate are not fields of the same table...)
Thanks for any hints!
K
hope this helps you
count({$<status={active}, xDate = {" >= yDate"}>} xDate)
hi kalinkula,
your expression is logically incorrect.
try the following code...
count({$<status={active}, xDate = {">= yDate"}>} xDate)
Rgrds,
Abhinava
thanks for the quick reply. unfortunately it still returns 0. i simplified the expr:
count({$<xDate = {" > yDate"}>} xDate) --> returns 0
but
count ( if (xDate > yDate, xDate ) ) --> returns 260
How come ?
Thanks a lot!
K
hi Kalinkula,
for the first expression to work, there should be atleast o ne selection in the yDate field.
the second expression works because it is calculating all the possible combinations where xDate is greater than yDate.
Rgrds,
Abhinava