Announcements
Product Release Webinar: Qlik Insider airing December 6! REGISTER TODAY!
cancel
Showing results for
Did you mean: Not applicable

## set analysis

hi

i facing the problem with set analysis

chart

dimension - ename, empno, hiredate

expr- sum({<MonthNumStd={">=\$(=date(max(MonthNumStd)-2))<=\$(=max(MonthNumStd))"}>}[SAL S])

according to this expression chart should show the sum of salary of emp, whose joining lie between final two month of max(month) selection.

But It it is showing the sum of current month employee only.

i have attached the file.

2. question ...

i want to show only those employees whose salary = 3000

sum({ (is i need to write again same expression here = 3000),

<MonthNumStd={">=\$(=date(max(MonthNumStd)-2))<=\$(=max(MonthNumStd))"}>}[SAL S])

1 Solution

Accepted Solutions  MVP

Exactly = 3000? It could be If(sum({<MonthNumStd={">=\$(=max(MonthNumStd)-2)<=\$(=max(MonthNumStd))"}, Month>}[SAL S])=3000, 3000)

Also, in set analisys, If you use date() it will return a date from year 1900, think it should be only:

MonthNumStd={">=\$(=max(MonthNumStd)-2)<=\$(=max(MonthNumStd))"}

It takes 3 months if dec is selected, from 10 to 12, both included.

5 Replies  MVP

Something wrong in your data model or script....

Select 2013 from YearStd and write a text box expression as SUM([SAL S])...

It's showing 0... Am I Missing something or understanding Something wrong? Anonymous
Not applicable
Author

You currently have Dec selected as a month and your current set is using the default.

Therefore, you need to add the Month= at the end of your Set Analysis expression:

sum({<MonthNumStd={">=\$(=date(max(MonthNumStd)-2))<=\$(=max(MonthNumStd))"},Month=>}[SAL S])

I'm working on the salary requirement now. Not applicable
Author

Actually i have created master calendar based on min ,max date of hiredate of EMP table.

Wrt to year which have no data in emp table , it showing 0.00, which is not a big deal at all ithink.

so why it is showing 0.00  MVP

Exactly = 3000? It could be If(sum({<MonthNumStd={">=\$(=max(MonthNumStd)-2)<=\$(=max(MonthNumStd))"}, Month>}[SAL S])=3000, 3000)

Also, in set analisys, If you use date() it will return a date from year 1900, think it should be only:

MonthNumStd={">=\$(=max(MonthNumStd)-2)<=\$(=max(MonthNumStd))"}

It takes 3 months if dec is selected, from 10 to 12, both included. Not applicable
Author

thanx to all Community Browser