Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis - excluding values with condition sum

Goodmorning everyone,

Can you help me on this Set Analysis.


sum({<FlagLYTLM={1},Year=,YearID=,YearMonth=,EconomicYear=,CLASSE_CLIENTE={Marginali}, CLI_COD -= {"=sum({<FlagCYTLM={1},Year=,YearID=,YearMonth=,EconomicYear=>}$(varFatturato))<=0"}>} $(varFatturato))


My goal is to exclude from the initial sum (sum({<FlagLYTLM={1},Year=,YearID=,YearMonth=,EconomicYear=,CLASSE_CLIENTE={Marginali})....) all customers (CLI_COD) that have satisfied the second sum.

(sum({<FlagCYTLM={1},Year=,YearID=,YearMonth=,EconomicYear=>}$(varFatturato))<=0"})


these flags identify different years of data sets

FlagLYTLM = Last Year

FlagCYTLM =  Current Year.


The formula above does not work I


Thank you all

1 Solution

Accepted Solutions
sunny_talwar

Here try this:

Sum(Aggr(If(

Sum({<FlagCYTLM={1},Year=,YearID=,YearMonth=,EconomicYear=,CLASSE_CLIENTE={Marginali}>} $(varFatturato)) = 0,

Sum({<FlagLYTLM={1},Year=,YearID=,YearMonth=,EconomicYear=,CLASSE_CLIENTE={Marginali}>} $(varFatturato))), CLI_COD, CLASSE_CLIENTE))

Capture.PNG

View solution in original post

6 Replies
sunny_talwar

The expression looks good to me (syntax wise). Would you be able to share a sample to look at this in dept?

Anonymous
Not applicable
Author

I attach files, reduced application and Excel files containing the result.

Thank you

Manuel

sunny_talwar

Which tab am I looking at in your attached qvw? Also what is column 2014 and 2013 in your Excel file? Those are the numbers you are looking to see in your application?

Anonymous
Not applicable
Author

The column in the application that should give the result is NETTO YTD 2013

In the Excel file the column is 2013. It must add the values of the 2013 column that have 0 in the 2014 column.

sunny_talwar

Here try this:

Sum(Aggr(If(

Sum({<FlagCYTLM={1},Year=,YearID=,YearMonth=,EconomicYear=,CLASSE_CLIENTE={Marginali}>} $(varFatturato)) = 0,

Sum({<FlagLYTLM={1},Year=,YearID=,YearMonth=,EconomicYear=,CLASSE_CLIENTE={Marginali}>} $(varFatturato))), CLI_COD, CLASSE_CLIENTE))

Capture.PNG

Anonymous
Not applicable
Author

thank you very much works perfectly!!!

Manuel