Community
This field is required.
Only these extensions are allowed(.jpg, .JPG, .jpeg, .JPEG, .gif, .GIF, .png, .PNG)
Tags cannot contain the characters ' /, \\, #, ?, or ; >,< '
Only these extensions are allowed(.zip,.ZIP,.pdf,.PDF,.qvf,.QVF,.qvw,.QVW)
QlikView documentation and resources.
Hi community,
"Where should the set modifier be placed? Inside and/or outside the aggr()?"
The standard answer is mostly:
"If you are unsure, you should place the set modifiers inside and outside the aggr(). This will probably lead to the desired result..."
I just can't agree. In my opinion it really, really! depends...
Example 1
sum(aggr(sum(F4),F1))
--> default case
sum(aggr(sum({<F2={"D","E"}>} F4),F1))
--> set modifier at inner aggregation limits F4 values
sum({<F2={"D","E"}>} Rangesum(F3,aggr(sum(F4),F1)))
--> set modifier at outer aggregation
--> no difference , because F1={A} exists for F2={D} and F1={B} exists for D2={E}
sum({<F2={"D"}>} aggr(sum(F4),F1))
--> F1={A} exists for F2={D} and F1={B} doesn‘t exist for D2={E}
sum({<F2={"D"}>} aggr(sum({<F2={"D"}>}F4),F1))
--> set modifier at inner and outer aggregation
Example 2
sum(Rangesum(F3,aggr(sum(F4),F1)))
sum(Rangesum(F3,aggr(sum({<F2={"D","E"}>} F4),F1)))
--> set modifier at inner aggregation limits F4 values inside aggr()
--> but doesn’t limit F3 outside aggr()
--> set modifier at outer aggregation limits only F3 field, because F1={A} exists for F2={D} and F1={B} exists for D2={E}
sum({<F2={"D"}>} Rangesum(F3,aggr(sum(F4),F1)))
--> limits F3 and F4, because F1={A} exists for F2={D} and F1={B} doesn‘t exist for D2={E}
sum({<F2={"D"}>} Rangesum(F3,aggr(sum({<F2={"D"}>} F4),F1)))
--> set modifier at inner and outer aggregation limts F3 and F4 values
Regards
Robin
My congratulations on the material. More didactic is impossible.