Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community!
I have an IF statement (that works) as follows:
=IF(Sum (Schedule) >0), Sum(Schedule) - Sum(Amount), 0)
when I introduce set analysis into this IF statement, it doesn't work anymore.
for example:
=IF(Sum ( {$<SiteName = {Rochester} Schedule) >0), Sum( {$<SiteName = {Rochester} Schedule) - Sum( {$<SiteName = {Rochester} Amount), 0)
One thing to note is that the SiteName is from a Load Inline statement like below. I don't know if this is causing any of my issues however.
SiteLoc:
LOAD * INLINE [
SiteName, Site, BrandType
Rochester, 4005, MHL
Rochester, 4045, MHL
Rochester, 4043, MHL
Rochester, 4305, USB
Rochester, 4345, USB
Rochester, 4343, USB
Wisconsin, 4007, MHL
Wisconsin, 4055, MHL
Wisconsin, 4307, USB
Wisconsin, 4355, USB
];
Does anybody know why i'm having these issues?
Hi! Not sure that it's the whole solution but there are syntax errors. Try:
=IF(Sum ( {$<SiteName = {Rochester}>} Schedule) >0), Sum( {$<SiteName = {Rochester}>} Schedule) - Sum( {$<SiteName = {Rochester}>} Amount), 0)
Hi Thomas,
Sorry about my bad syntax, but the syntax is not the issue. Your solution/syntax is correct, but it just won't work in my document for some reason.
Can you also post a load inline with Schedule, amount and the key to the sitename table?
Hi,
the expression is still wrong:
=IF(Sum ( {$<SiteName = {Rochester}>} Schedule) >0, Sum( {$<SiteName = {Rochester}>} Schedule) - Sum( {$<SiteName = {Rochester}>} Amount), 0)
Hi,
Try this:
=IF(Sum ({$<SiteName = {"Rochester"} >} Schedule)>0,
Sum({$<SiteName = {"Rochester"} >} Schedule) - Sum( {$ <SiteName= {"Rochester"} >} Amount),
0)
If above will not work, it must be something with your data.
Regards,
Janusz