Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
prasad333
Contributor III
Contributor III

Set expression 1

Hi everyone,

I just came across a situation. So here it is -

Suppose you have two tables

Tab1:                          Tab2:

EMP  SALARY          EMP   SALARY

A        10000              D       40000

B        20000              E       50000

C      30000                F       60000

D      40000                G      70000                

E      50000

1. I have to show the salaries of those employees who are

   a) present in tab1 but not in tab2

   b) present in both the tabs

   c) 3 highest paid employees from both the tabs

   d) employees who have the same salary status

- write the solutions for both front end and back end.

Regards,

KHARANSU RATH

3 Replies
arvind_patil
Partner - Specialist III
Partner - Specialist III

HI Karansu,

Please do as follows:

a) present in tab1 but not in tab2


Where exist


b) present in both the tabs

Inner join

   c) 3 highest paid employees from both the tabs

Concatenate both tables and Dimesion limit top 3:

   d) employees who have the same salary status:

   Employee& salary as Key

inner join both the tables.

Thanks,

Arvind Patil


prasad333
Contributor III
Contributor III
Author

Hey Arvinnd,

first of all thank you for replying but I would like to stretch this discussion a bit. For question a & b, what set expressions should I write to get the required results?

Anil_Babu_Samineni

Perhaps this?

Qualify *;

Tab1:

Load EMP, SALARY From T1;

Concatenate (Tab1)

QUALIFY *;

Tab2:

Load EMP, SALARY From T2;

1) Sum(Tab1.SALARY)

2) RangeSum(Tab1.SALARY, Tab2.SALARY)

3) Sum({<Tab1.EMP = {"=Rank(-Sum(Tab1.SALARY)) <= 3"}, Tab2.EMP = {"=Rank(-Sum(Tab2.SALARY)) <= 3"}>} SALARY)

4) RangeSum(If(Tab1.SALARY = Tab2.SALARY), Tab1.EMP & Tab2.EMP)

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