# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for
Search instead for
Did you mean:
Creator

## Set Analysis

Hi ,

Please help me with the following requirement.

YEAREMPID
2016GIS11
2016GIS12
2016GIS13
2017GIS12
2017
 GIS13
2018GIS10
2018GIS12
2018GIS13

If I select year 2016, all the EMPIDs in 2016 should be displayed.

If I select year 2017, GIS11 should be displayed (because other 2 EMPIDs are common in 2016 & 2017)

If I select year 2018, GIS10 should be displayed (because other 2 EMPIDs are common in 2017 & 2018)

Note: This should be accomplished only using set analysis in a straight table.

Thank you.

Message was edited by: Than Mughi

1 Solution

Accepted Solutions
Creator
Author

Yeah I got the answer.

This is the solution

concat({<Year={\$(vLastYear)}+{\$(vmaxyear)},EMPID=E({<Year={\$(vmaxyear)},EMPID=P({<Year={\$(vLastYear)}>}EMPID)>}EMPID)>}EMPID,',')

6 Replies

Output please and which object?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Champion III

What is your expected output for 2017 and 2018. You are saying 2016 all empid's should display, in 2017 empid's not in both 2016 and 2017, But your 2016 year has all EMPIds how can you get empid's not in 2016 and 2017 for 2017?Can you elaborate please?

Master II

Hi Try this,

='For 2016,it should display all EMPID  :' &COUNT({<Year={'2016'}>}EMPID)

7

='For 2017,display the EMPID not in both 2016 and 2017 :' &count (distinct  {<EMPID = P ({<Year={'2016'}>} EMPID ) >*<EMPID = E ({<Year={'2017'}>} EMPID ) > } EMPID )

2

='For 2018,display the EMPID not in both 2017 and 2018 :' &count (distinct  {<EMPID = P ({<Year={'2017'}>} EMPID ) >*<EMPID = E ({<Year={'2018'}>} EMPID ) > } EMPID )

2

Looks like you already got answer - set analysis

Note - I suggest you to don'e duplicate threads instead you can reply here to get correct answer.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Master II

Hi thannila

Did you get the answer?

Creator
Author

Yeah I got the answer.

This is the solution

concat({<Year={\$(vLastYear)}+{\$(vmaxyear)},EMPID=E({<Year={\$(vmaxyear)},EMPID=P({<Year={\$(vLastYear)}>}EMPID)>}EMPID)>}EMPID,',')