Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
googel84
Partner - Creator III
Partner - Creator III

$-signed Set analysis expression seems to go beyond selections

I recently solved an issue thanks to Gysbert Wassenaar (see Nested aggregation not allowed issue) but the solution brought me to an other doubt, concerning a set analysis that seems to go beyond selections made on document fields.


To be more precise, I have a Year field and the following formulas in a bar chart.

This one to get 2014 YTD sales...

sum({$< DATA_MOV_MAG.ANNO = {$(=$(vAnnoPiuRecente))} >}

     if( inyeartodate(

            DATA_MOV_MAG,

            makedate($(=$(vAnnoPiuRecente)),num(month('$(vDataBase)')),num(day('$(vDataBase)'))),

            0),

       VALORE_EURO,

       0

    )

)

... and this one to get 2013 LYTD sales

sum({$< DATA_MOV_MAG.ANNO = {$(=$(vAnnoPiuRecente)-1)} >}

     if( inyeartodate(

          DATA_MOV_MAG,

          makedate($(=$(vAnnoPiuRecente)-1),num(month('$(vDataBase)')),num(day('$(vDataBase)'))),

          0),

     VALORE_EURO,

     0

  )

)

What happens is that I still see values returned by the 2013 formula even if the user selects only one value from the Year field.

Immagine.png

How is it possible?

1 Solution

Accepted Solutions
whiteline
Master II
Master II

Hi.

With set analysis you take current set {$} and modify it overriding the user selections.

If you want to keep the selections use intersection of these sets (refer to help 'set analysis').

View solution in original post

1 Reply
whiteline
Master II
Master II

Hi.

With set analysis you take current set {$} and modify it overriding the user selections.

If you want to keep the selections use intersection of these sets (refer to help 'set analysis').