Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
matthewp
Creator III
Creator III

Qlikview expression not affected by selection EXCEPT two specific fields

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.

3 Replies
sunny_talwar

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))

matthewp
Creator III
Creator III
Author

still getting changes when another field has a selection

sunny_talwar

Do you have a sample you can share?