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: 
william_allen
Contributor III
Contributor III

Set analysis - field > a date format

Hi All,

I am having an issue with the following expression hopefully someone can help shed a little light on it.

=count({1<[CALL URGENCY]={'Critical'}, [CALL STATE]={'Open'}, [ACTUAL_LOG_DATE]={"<$(vCriticalTime)"}>} [CALL_NUMBER])

The problem is with:  [ACTUAL_LOG_DATE]={"<$(vCriticalTime"}

To explain what's going on a little better:

vCriticalTime = Timestamp(now()-0.1667, 'YYYY-MM-DD hh:mm:ss')

ie vCriticalTime = '2014-07-23 10:46:37 '

The count always comes out as 0 which is wrong.

Can anyone see where I'm going wrong when trying to determine if my vCriticalTime is less than the [ACTUAL_LOG_DATE]?

Thanks for your help

Update fixed the missing ) , still having same issue

21 Replies
Not applicable

Looks like you might have forgot a closing parenthesis:


[ACTUAL_LOG_DATE]={"<$(vCriticalTime)"}

preminqlik
Specialist II
Specialist II

hi try this

you didnot closed the variable bracket try below one

count({1<[CALL URGENCY]={'Critical'}, [CALL STATE]={'Open'}, [ACTUAL_LOG_DATE]={">$(vCriticalTime)"}>} [CALL_NUMBER])

william_allen
Contributor III
Contributor III
Author

Thanks I noticed that after I pasted it up, still doesn't fix it. The count is coming back as 0

lironbaram
Partner - Master III
Partner - Master III

hi

you need to make sure

that both vCriticalTime and Actual_Log_Date have the same format

this is a reason why for those kind of formula i like to have my date fields as numbers

Not applicable

Are you able to share a sample?

Not applicable

A few suggestions:

  • Instead of the variable try hard-coding the value and see if the expression works fine
  • If it does, then next put the variable in a text box and see if you get the desired result
  • Probably while defining the variable in Settings > Variable overview you might have to use '=' then the expression

Give it a whirl. If none of these work please attach a sample file for deeper investigation.

Thanks

AJ

william_allen
Contributor III
Contributor III
Author

Thanks Liron, I checked, they do have the same format here are examples of different values for them

Actual log date = 2014-07-22 10:40:23.000

Critical Time = 2014-07-23 11:08:47

annafuksa1
Creator III
Creator III

Could you post your App ? it will be faster

william_allen
Contributor III
Contributor III
Author

Sorry I can't post a version of the app.