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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to write Set analysis?

Hi Community,

I have data of all month refer below table.

Emp_no.     Emp_designation

1                AB

2               CD

3               EF

4               GH

5               JK

suppose i have select only current month for above table have to show the current month data.so how to write set anaylsis for this condition ?

e.g.

Emp_no.     Emp_designation        Current_Month_Emp_Designation

1                 AB                                   AB

2                 CD                                   CD

3                 EF                                    EF

thanks in advance.

13 Replies
jpenuliar
Partner - Specialist III
Partner - Specialist III

Hi,

have a go with this link:

Set Analysis Wizard for QlikView | qlikblog.at

this has helped me lotsa times.

JP

Not applicable
Author

Hi everyone,

in my database period column is showing below formate-:

Emp_no.     Emp_designation   Period

1                     AB                              10/23/2014                        

2                    CD                               10/25/2014  

3                    EF                                10/29/2014  

4                    GH                                9/28/2014

5                    JK                                 9/26/2014

if i select period month is current month suppose (e.g month octomber (10)) then table have to show only octomber month data refer below example formate -:

e.g.


Emp_no.     Emp_designation        Current_Month_Emp_Designation 

1                      AB                                        AB

2                      CD                                       CD

3                      EF                                         EF

so how to bring Third column(i.e. Current_Month_Emp_Designation) according to selection of period.i have tryed below expression

sum(<period={"$ (=max(period))"}>Emp_designation)


but it showing zero value i want output like third column(refer above output )

MK_QSL
MVP
MVP

Use below in your script...

Load *, Month(Period) as Month;

Load Emp_no, Emp_designation, Date(Alt(Date#(Period,'M/DD/YYYY'),Date#(Period,'M/D/YYYY'))) as Period Inline

[

  Emp_no,Emp_designation,Period

  1, AB, 10/23/2014                       

  2, CD, 10/25/2014 

  3, EF, 10/29/2014 

  4, GH, 9/28/2014

  5, JK, 9/26/2014

];

Now create a Straight Table

Dimension

Emp_no

Emp_designation

Expression

Only({<Month = {'$(=Month(Today()))'}>}Emp_designation)

If you want to count number of Employee for current month, use below

Count({<Month = {'$(=Month(Today()))'}>}Emp_designation)

or

Count({<Month = {'$(=Month(Today()))'}>}Distinct Emp_designation)

Not applicable
Author

Thank u everyone for your help,

thank u manish