Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a Qlikview expression that I want it to not be affected by any selections EXCEPT two specific fields: `Year` & `Month`.
My Expression is:
Sum(Aggr(IF(Duration = 0.5 , 0.5,
IF(DayName = 'Sat',0,
IF(DayName = 'Sun',0,
RangeSum(
Count({<Key = {"=Len(Trim([Date From])) > 0"}>}DISTINCT Name),
Avg({<Key = {"=Len(Trim([Date From])) = 0"}>}0))))), Name, ADate))
I know you can use something like; `{1<Year = $:: Year>}` & `{1<Month = $:: Month>}` to accomplish this but I cant quite get it right.
How about this:
Sum({1<Year = $:: Year, Month = $::Month>} Aggr(If(Only({1<Year = $:: Year, Month = $::Month>} Duration) = 0.5 , 0.5,
If(Only({1<Year = $:: Year, Month = $::Month>} DayName) = 'Sat', 0,
If(Only({1<Year = $:: Year, Month = $::Month>}DayName) = 'Sun', 0,
RangeSum(
Count({1<Key = {"=Len(Trim(Only({<Year = $:: Year, Month = $::Month>}[Date From]))) > 0"}, Year = $:: Year, Month = $::Month>}DISTINCT Name),
Avg({1<Key = {"=Len(Trim(Only({<Year = $:: Year, Month = $::Month>} [Date From]))) = 0"}, Year = $:: Year, Month = $::Month>}0))))), Name, ADate))
still getting changes when another field has a selection
Do you have a sample you can share?