Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
warrentk80
Creator
Creator

calculation independent of selections

good evening

I need to apply a calculation on a esperessione the type Operator (1) / Operator (2)

in the data base operators are distributed over several months of the year.

in this expression must always calculate the formula selected on the year while the filter of the month (which I used in other expressions, in this expression should not be considered)

would know someone show me how to apply this formula only on the year while not selected must consider the selection of the month?


thanks

Andrea

1 Solution

Accepted Solutions
Not applicable

SUM({< Year={$(=only(Year))}, Month= >} Sales)

View solution in original post

6 Replies
maxgro
MVP
MVP

non so se interpreto correttamente: con la set analysis puoi non considerare le selezioni su un campo, ad esempio


sum( {$<Region = >} Sales )
returns the sales for the current selection, but with the selection in “Region” removed

nel tu caso lo applichi al mese

Not applicable

SUM({< Year={$(=only(Year))}, Month= >} Sales)

MK_QSL
MVP
MVP

Something Like Below

SUM({<Month = >}Sales)

warrentk80
Creator
Creator
Author

Ciao Massimo, hai interpreato correttamente.

ora però avrei un altra necessità similare.

nella base dati ho un insieme di operatori suddivisi per mese,

con la formula operatore1/operatore2 ottendo un risultato che aggreggato per mese mi dice mese per mese qual'è il risultato del rapporto.

ora avrei la necessità che se seleziono un mese (ad esempio agosto) ottengo il minimo risultato (da gennaio ad agosto)

il problema è che non posso escludere il mese dalla selezione, ma se selezioni il mese , il tutto viene filtrato per quel mese. per cui il minimo è il risultato di quel mese.

Riusciresti a darmi una mano anche in questo caso?

warrentk80
Creator
Creator
Author

Thank you for your kind answers.

if I have to calculate the one-year data everything works fine excluding the month as I have indicated.

I now need a similar

in the database I have a set of operators on a per month,

with the formula operatore1/operatore2 by obtaining a result that aggregate per month for each month tells me what is the result of the relationship.

Now I need that if I select a month (eg August) I get the minimum result (January to August)

the problem is that I can not exclude the month of selection, but if you select the month, everything is filtered for that month. for which the minimum is the result of that month.

Could you give me a hand in this case?

maxgro
MVP
MVP

Andrea ti conviene aprire un altro post e se ti è possibile postare il qvw o un estratto relativo al solo problema

Perchè un altro post? i post con le risposte (verdi) sono presi in considerazione solitamente da chi cerca le risposte per domande simili, non da chi  dà le risposte quindi hai poche probabilità che ti rispondano  

Perchè postare il qvw? quando la domanda si complica + è specifica + è facile rispondere e meglio dell'esempio..........

Con le date (anni, mesi, ...) inoltre spesso sorgono problemi di interpretazione (stringa, numero), etrc......

bè comunque, già che ci sono provo: l'anno + grande (anche tra i non selezionati, se vuoi forzare la selezione usa Only) ed il mese da gennaio al + grande

SUM({< Year={$(=max(Year))}, Month={"<=$(=Max(Month))"} >} Sales)