Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to get the count of ids where the difference between two dates is greater than 30. Please help me with the syntax.
Thanks,
Sudha.
Try something like this: count({<UPDATE_DT={"<$(=Today()-30)"}>} distinct CASE_ID)
If that doesn't work please post a small qlikview document that demonstrates the problem so we can find out what will work correctly with your data.
Count( { <CASE_ID={"=Now()-Update_DT>30"}> } CASE_ID )
maybe even with DISTINCT
Count( DISTINCT { <CASE_ID={"=Now()-Update_DT>30"}> } CASE_ID )
Gysbert and Petter were right.
other way is using the If condition,
=Count(If((Date(Now())-Date(UPDATE_DT)) > 30, CASE_ID)
or Distinct:
=Count(Distinct(If((Date(Now())-Date(UPDATE_DT)) > 30, CASE_ID))
The solution that Gysbert and I recommend is using a so-called Set Expression.
The set which is enclosed in curly braces { and } defines which subset of rows that should be used in the Count.
Furthermore the angle brackets < and > enclosed a set modifier that works as a where. So it says that the field mentioned CASE_ID (in my suggestion) should be based on the search condition which is enclosed in double quotation marks and starts with an equal sign. The search is then for rows where the difference between now and Update_DT is greater than 30.
Thanks for the help and the great explanation on the syntax.
Could you please check what I am missing -
None of the above syntax is producing the result. I don't see any error in the editor but it just outputs 0 everywhere.
Thanks,
Sudha.
maybe
count({<UPDATE_DT={"<$(=Date(Today()-30))"}>} distinct CASE_ID)
see attachment
Hi,
Please let me know how to attach a qvw file. The attachment option I see here accepts only urls. Is there a way to choose a file from my local and attach it here?
Thanks,
Sudha.
reply
use advanced editor (top right)
attach (bottom right)
Thank you!
I have the QVW here. Please have a look. It's only displaying zeros.