Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

function in first part of identifier set analysis

I have a date field with format D-M-YYYY hh:mm:ss

I want to count the number of employees who have september as first month of appearance

I tried count({<month(min(datefield))={9}>} employeenumber) .

Instead of {9} i tried {'sep'} and {'9'}  too but I don't get the correct results.

Is it not possible to use the min and month function this way ?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try this?

=count(Distinct {<employee={"=month(min(changedate2))='sep' "}>} employee)

View solution in original post

15 Replies
pradosh_thakur
Master II
Master II

in the script editor by default SET DateFormat='M/D/YYYY'; will be there but your format is diffrent

change it to SET DateFormat='D/M/YYYY'; OR SET DateFormat='D-M-YYYY';


Hopefullt it will work if your expression is correct as per your filed name .


regards

Pradosh

Learning never stops.
tresesco
MVP
MVP

Try like:

count(Distinct {<datefield={"=Month(Min({1} datefield))='Sep' "}>} employeenumber)



curiousfellow
Specialist
Specialist
Author

Qlik interprets my datefield correct. Tried it with date#(datefield, 'D-M-YYYY') too

However I get "Error in set modifier expression" with a red line below the {  of {9}

pradosh_thakur
Master II
Master II

I would do this and try


count({<'month(min(datefield))'={9}>} employeenumber)


use distinct if needed.


regards

Pradosh

Learning never stops.
pradosh_thakur
Master II
Master II

did it work?

Learning never stops.
tresesco
MVP
MVP

Pradosh,

In set analysis, LHS of '='; a modifier has to be a script generated field name rather than expression.

curiousfellow
Specialist
Specialist
Author

No, this did not work either. I get a wrong result. It counts every lowest datevalue.

pradosh_thakur
Master II
Master II

hi tresesco

i understand that but if he is using a function it should be enclose between single quotes and it is even working for me. please correct me if i am wrong but is it a wrong practice or not at all allowed is Qlik?

Capture.PNG

Capture.PNG

Regards

Pradosh

Learning never stops.
pradosh_thakur
Master II
Master II

post a sample and lets try with that.

regards

Pradosh

Learning never stops.