PaulP2
Technical User
- Mar 6, 2006
- 5
I am migrating reports from Crystal 11 to Cognos 8.4, after one week of training. I am having a lot of trouble, and I can't seem to find resources, other than forums, that will help with the detailed syntax questions that keep coming up.
For example, why does this sample code test ok
case
when
(substr([Revenue Summary].[Calendar].[Current Fiscal Period],5,2) in ('05','06','07','08','09','10','11','12')) THEN '1' ELSE '2'
end
but this code does not?
if
(substr([Revenue Summary].[Calendar].[Current Fiscal Period],5,2) in ('05','06','07','08','09','10','11','12')) THEN '1' ELSE '2'
In the second case, I get an error labeled QE-DEF-0261 QFWP.
In short, I think I need to use if-then-else instead of case, as I have been told that I can't use ANDs and ORs in case statements. So what is the correct syntax for if-then-else statments?
For example, why does this sample code test ok
case
when
(substr([Revenue Summary].[Calendar].[Current Fiscal Period],5,2) in ('05','06','07','08','09','10','11','12')) THEN '1' ELSE '2'
end
but this code does not?
if
(substr([Revenue Summary].[Calendar].[Current Fiscal Period],5,2) in ('05','06','07','08','09','10','11','12')) THEN '1' ELSE '2'
In the second case, I get an error labeled QE-DEF-0261 QFWP.
In short, I think I need to use if-then-else instead of case, as I have been told that I can't use ANDs and ORs in case statements. So what is the correct syntax for if-then-else statments?