Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
chapil
Contributor III
Contributor III

set analysis expression

Hello guys, 

I have datas on my application, but I don't need the all datas on my sheet

So I put some filters in it like Country (FR and EN), Mag ( 1, 2, 3)

I want also to filter my datas trought the time : Time ( 12 months 012020 to 012021) 

My problem is :

I want a line chart for the sales per month (according to the selection of 1 mag and one date selection) - this is working

And want on the same chart a line with the average sales (all mag) for the same duration (according to the selection). So I try with a set analysis with {1} but it's not what I want (cause I have filters on the sheet and not in the all app)

I would like to do it like this :

AVG ({1} <country = {'FR','EN'}, time= {$ an expression to say the current selection }, [Sales])

Thanks a lot

 

PS: if it's not possible or not clear tell me either 

 

1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

you are right, {1} will ignore ALL your selections.  To ignore specific fields you can do this: mag = in your set analysis.

 

 

AVG (<mag =, country = {'FR','EN'}, time= {$ an expression to say the current selection }, [Sales])

View solution in original post

4 Replies
stevejoyce
Specialist II
Specialist II

you are right, {1} will ignore ALL your selections.  To ignore specific fields you can do this: mag = in your set analysis.

 

 

AVG (<mag =, country = {'FR','EN'}, time= {$ an expression to say the current selection }, [Sales])

chapil
Contributor III
Contributor III
Author

To explain better, 

chapil_0-1630072725409.png

so, want to calculate average only for green datas, according to my selection mag and time

 

chapil
Contributor III
Contributor III
Author

Perfect, all I wanted 

Thanks !

Vegar
MVP
MVP

Consider this data set.


DATAS:
LOAD Country,Monthname(Date) as Date, Sales, Mag INLINE [

Country,Date, Sales, Mag
FR, 2020-08-01, 10, 1
FR, 2020-07-01, 20, 1
FR, 2020-07-01, 30, 2
FR, 2020-08-01, 0,  2
EN, 2020-08-01, 50, 3
EN, 2020-08-01, 100,4
EN, 2020-07-01, 0,  4
EN, 2020-07-01, 20, 3
];

You can get this chart from the two expressions (If you make selection Mag=1 and Country = EN, FR.)Vegar_0-1630074968934.png