Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a couple of variables, each having the same sort of structure - which is summing stuff together. e.g.
vMarketableWeight = (SUM[field A] + SUM[field B] + SUM[field C] etc....)
These work fine when called from within a visualization with $(vMarketableWeight).
I've hit a snag using these with set analysis. The syntax I want to use is:
SUM({$<
MarketableOrOutsize = "",
[Size Bucket] = ""
>}
$(vMarketableWeight)/($(vMarketableWeight) + $(vOutsizeWeight))* 100
)
This bit: $(vMarketableWeight)/($(vMarketableWeight) + $(vOutsizeWeight))* 100 works fine on its own.
I'm guessing it's something to do with sums of sums - or evaluation precedence....but my knowledge is limited.
Any ideas please?
I don't want to change the structure of my variables as they're well used.
Cheers,
Hi Vineeth,
I misled a bit (sorry) I was trying to empty the two set modifiers (and forgot the syntax! - no swirly brackets or quotes required!!)
It still doesn't work - but this is effectively what I'm trying to do (but with the parts separated as you've suggested):
SUM({$<
MarketableOrOutsize =,
[Size Bucket] =
>}
$(vMarketableWeight) )
/
(
SUM({$<
MarketableOrOutsize =,
[Size Bucket] =
>}
>} $(vMarketableWeight) )
+
SUM({$<
MarketableOrOutsize =,
[Size Bucket]=
>}
>} $(vOutsizeWeight) )
)
Still pretty sure its the whole SUM or SUM thing that's the problem (i.e. each of the three variables are pretty much the same - i.e. SUM[field a] + SUM[field b] + SUM[field c] etc..
It's done like this because we're able to choose these fields in filter visualisations.
Cheers,
oh k, instead or Sum() + sum()
try Rangesum(field1,field2...etc)
in the first scenario if any value is null the whole expression becomes null, whereeas rangesum() will adjust for 0's
Can you upload a sample to look at
Preparing examples for Upload - Reduction and Data Scrambling