Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have been struggling with this issue for quite some time, I don't see any topic similar to this on the forum so I'm not sure if this is a bit unorthodox.
I have a couple of nested if-statements which calculate figures. In another table I need to add up the results of these nested if-statements, but I am unable to get it to work.
I am not able to do these calculations in the script, so I am forced to do it as expressions in tables.
See below my if-statements:
1.
If(If(If(ReportName='Umlaas',Count(distinct VINNo),0)-Sum(distinct FixedParking)<1,0,If(ReportName='Umlaas',Count(distinct VINNo),0)-Sum(distinct FixedParking))<1,0,
If(If(ReportName='Umlaas',Count(distinct VINNo),0)-Sum(distinct FixedParking)<1,0,If(ReportName='Umlaas',Count(distinct VINNo),0)-Sum(distinct FixedParking))*Max(VariablePrice))
2.
If(If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,0,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo))<1,0,If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,0,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo))*Max(VariablePrice))
3.
=If(If(If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo)<1,0,If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo))<1,0,If(If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo)<1,0,If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo))*Max(VariablePrice))
4.
If(If(If(If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo)<1,If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo),0)+Count({<ReportName={'Pomona 2'}>}distinct VINNo)<1,0,If(If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo)<1,If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo),0)+Count({<ReportName={'Pomona 2'}>}distinct VINNo))<1,0,If(If(If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo)<1,If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo),0)+Count({<ReportName={'Pomona 2'}>}distinct VINNo)<1,0,If(If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo)<1,If((If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo)<1,
(If(Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking)<1,Count({<ReportName={'Umlaas'}>}distinct VINNo)-Sum(distinct FixedParking),0))+Count({<ReportName={'Pomona'}>}distinct VINNo),0)+
Count({<ReportName={'VDS @ Atlas'}>}distinct VINNo),0)+Count({<ReportName={'Pomona 2'}>}distinct VINNo))*Max(VariablePrice))
There are two more, each one longer than the previous.