Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
QSense
Creator II
Creator II

script

Hello,

I wrote a set analysis statement caluclates between max(answertime) -1 and max(answertime)

but ıi does not bring any values.

I am probably making mistake .

Could you help me

=sum({$<ANSWERTIME={">=$(date(max(ANSWERTIME)-1,'DD.MM.YYYY 00:00:00')) <$(=date(max(ANSWERTIME),'DD.MM.YYYY 00:00:00'))"}>}CALL_AMOUNT)

17 Replies
er_mohit
Master II
Master II

Try this

=sum({<ANSWERTIME={">=$(Timestamp(max(ANSWERTIME)-1,'DD.MM.YYYY hh:mm:ss')) <$(=Timestamp(max(ANSWERTIME),'DD.MM.YYYY hh:mm:ss'))"}>}CALL_AMOUNT)


or

this

=sum({<ANSWERTIME={">=$(Date(max(ANSWERTIME)-1,'DD.MM.YYYY ff:ff:ff')) <$(=Timestamp(max(ANSWERTIME),'DD.MM.YYYY ff:ff:ff'))"}>}CALL_AMOUNT)

QSense
Creator II
Creator II
Author

I added two print screen

QSense
Creator II
Creator II
Author

sil_qww.png

ashfaq_haseeb
Champion III
Champion III

Your first part is missing and you have different date format.

Try like below

=sum({<ANSWERTIME={">=$(Timestamp(max(ANSWERTIME)-1,'DD/MM/YYYY hh:mm:ss')) <$(=Timestamp(max(ANSWERTIME),'DD/MM/YYYY hh:mm:ss'))"}>}CALL_AMOUNT)


Regards

ASHFAQ

anbu1984
Master III
Master III

Your ANSWERTIME format doesn't match format of date(max(ANSWERTIME)-1,'DD.MM.YYYY 00:00:00'))


Change format of date command to match with ANSWERTIME format


=sum({<ANSWERTIME={">=$(Timestamp(max(ANSWERTIME)-1,'DD/MM/YYYY hh:mm:ss TT')) <$(=Timestamp(max(ANSWERTIME),'DD/MM/YYYY hh:mm:ss TT'))"}>}CALL_AMOUNT)

QSense
Creator II
Creator II
Author

It didnt work again

anbu1984
Master III
Master III

Is ANSWERTIME in DD/MM or MM/DD? Accordingly fix format in Timestamp. Did you use TT in Timestamp format?

QSense
Creator II
Creator II
Author

format is MM/DD I changed with this format it still does not work