I implemented several ApplySimple to Oracle in MSTR 7.1 with this structure in order to handle nulls and no Least function.
ApplySimple(" CASE WHEN NVL(#2,0) < NVL(#1,0)
THEN NVL(#1,0)
ELSE Least(NVL(#2,0)-NVL(#1,0), NVL(#1,0))
END ",
Sum(Fact0),Sum(Fact1), Sum(Fact2))
-> One question is whether in 7.2 (7i) I can simplify it to the following due to native Case and Least statements:
CASE(WHEN Sum(Fact2) < Sum(Fact1)
THEN Sum(Fact1) ELSE Least(Sum(Fact2)- Sum(Fact1),Sum(Fact0)END)
or, alternatively:
CASE(WHEN Metric2 < Sum(Metric1)
THEN Sum(Metric1) ELSE Least(Metric2-Metric1,Metric1))
where the metrics corresponding to the facts
-> Another question is which version of MSTR first offered the CASE and LEAST/GREATEST functions? Was it 7.2?
Thanks.
ApplySimple(" CASE WHEN NVL(#2,0) < NVL(#1,0)
THEN NVL(#1,0)
ELSE Least(NVL(#2,0)-NVL(#1,0), NVL(#1,0))
END ",
Sum(Fact0),Sum(Fact1), Sum(Fact2))
-> One question is whether in 7.2 (7i) I can simplify it to the following due to native Case and Least statements:
CASE(WHEN Sum(Fact2) < Sum(Fact1)
THEN Sum(Fact1) ELSE Least(Sum(Fact2)- Sum(Fact1),Sum(Fact0)END)
or, alternatively:
CASE(WHEN Metric2 < Sum(Metric1)
THEN Sum(Metric1) ELSE Least(Metric2-Metric1,Metric1))
where the metrics corresponding to the facts
-> Another question is which version of MSTR first offered the CASE and LEAST/GREATEST functions? Was it 7.2?
Thanks.