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

Current Selection in Set Analysis

Hi,

how can i exclude current selection in set analysis for example if i have 2017Q1 data if i select this it should show only 2016Q1 and 2016Q2 it shouldn't show 2017Q1. my expresiion is as below

=if(YearQuarter = '2017Q1',

count({<YearQuarter={'2016Q1'},YearQuarter={'2016Q2'} >} ITEM))



please help me

28 Replies
devarasu07
Master II
Master II

Hi,

try like this,

=if(YearQuarter='2017Q1', count({$<YearQuarter={'2016Q1','2016Q2'}>} ITEM))


you using same field in filter selection and set analysis expression so set analysis ignore selection (to exclude single field in set analysis like this fieldname= or using the identifier as 1) won't work. you can use your count if method like above.

Thanks,Deva

Anil_Babu_Samineni

You expression seems okay to me, Are you facing any issue over subtotal? If so, Try this?

=Sum(Aggr(if(YearQuarter = '2017Q1', count({<YearQuarter={'2016Q1'},YearQuarter={'2016Q2'} >} ITEM)),YearQuarter))


If you want to exclude only current selection which is one

count({<YearQuarter -= {"=GetFieldSelections(YearQuarter)"}>} ITEM)


If you are selecting 2 or more then this

count({<YearQuarter -= {$(Concat(Chr(39) & GetFieldSelections(YearQuarter) & Chr(39), ',')}>} ITEM)


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
woshua5550
Creator III
Creator III

try this

Count({<YearQuarter=e(YearQuarter)>} ITEM)

himabinduch
Creator
Creator
Author

Hi Deva,

i tried but it is showing current selection as well for example if i clicked on 2017Q1 it should show only 2016Q3 and 2016Q2  it shouldn't show 2017 Q1 data.

thanks,

hima

himabinduch
Creator
Creator
Author

Hi Dave,

its excluding all the values for my case i need to exclude only current selection.

effinty2112
Master
Master

Hi Hima,

Try

count({1-$}ITEM)

Cheers

Andrew

woshua5550
Creator III
Creator III

then you need add "1" as identifier

try

Count({1<YearQuarter=e(YearQuarter)>} ITEM)

himabinduch
Creator
Creator
Author

Hey Andrew,

its working but its giving entire  data set . i have 5 quarter's of data like 2017Q1,2016Q4, 2016 Q3, 2016 Q2, 2016 Q1


if i select 2017Q1 data it should show only 2016Q4 AND 2016Q3  if i select 2016Q3 i need only 2016 Q1 like this i need

please help me on this.

himabinduch
Creator
Creator
Author

Hi Dave,

i have 5 quarter's of data like 2017Q1,2016Q4, 2016 Q3, 2016 Q2, 2016 Q1


if i select 2017Q1 data it should show only 2016Q4 AND 2016Q3  if i select 2016Q3 i need only 2016 Q1 like this i need i dont need to show selected  yera quarter data

please help me on this.