Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP 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.

1 Solution

Accepted Solutions
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)

View solution in original post

13 Replies
MK_QSL
MVP
MVP

For that you need to have Month column or Date column in your database...

Not applicable
Author

Hi Manish,

thank u for your qiuk reply.

i have Period column in my data base and i have also try below one expression

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

but it showing Zero valu and also don't know is it right or wrong?

so,need help

Not applicable
Author

Hi,

Here you dont have the Month column in your data.

MK_QSL
MVP
MVP

How your period column data looks like? Kindly provide sample...

Not applicable
Author

Dear Ishwar,

If you have period in your data base then acc. to qlikview logic If you select a month form period then it will automatically show current month data.

Thanks & Regards

Prince Anand

PrashantSangle

Hi,

if period is date format then you have to use =Month(max(Period))

Try like this

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

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Dear Ishwar,

Something is missing in your expression :-

Your expression:- sum(<period={"$ (=max(period))"}>Emp_designation)

Modified expression:- sum({<period={"$ (=max(period))"}>}Emp_designation)

Try this one.

Thanks & Regards

Prince Anand

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

  • Is period a numeric field?
  • You are trying to sum the text field [Emp_designation]. Do you mean Count()?
  • You may need a distinct

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

share the sample data for period coloumn