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: 
samuel_brierley
Creator
Creator

count if

count ({$< [Fault Cleared] = {"<=$=(Max([Date Detected]))"}>}[Fault Cleared]

Can someone explain what is wrong with this expression?

what its supposed to do is count all row where Fault Clearerd is less than the Max Date detected

12 Replies
swuehl
MVP
MVP

Could just be a mispositioned opening bracket and missing closing bracket:

count ({$< [Fault Cleared] = {"<=$(=Max([Date Detected]))"}>} [Fault Cleared] )

Not applicable

try this , you miss the = sign

count ({$< [Fault Cleared] = {"<=$(=Max([Date Detected]))"}>} [Fault Cleared] )

samuel_brierley
Creator
Creator
Author

Nope niether of them are working.

samuel_brierley
Creator
Creator
Author

Ive been trying with this for a while and im unsure why im finding it so difficult. all it needs to do is count all record with the Fault Cleared is less than the max Date detected.

swuehl
MVP
MVP

Nope niether of them are working.

As you probably know from your work as a developer, "not working" is not a good issue description...

Well, start with checking if the dollar sign expansion results in something useful, put

=Max([Date Detected])

into a text box.

What do you get?

If you get something, it's probably a date, right?

What is the format of that date value? What is the format of field [Fault Cleared] and what is your default date format?

samuel_brierley
Creator
Creator
Author

sorry you are right not a good description but Im no developer, Im just trying to learn the tool for work, as you can understand its very difficicult for those of us who have no previous experience in this.

the formats are all the same and are "dd/mm/yyyy"

Ive used the text box to give max Date detected, max date cleared and count date cleared and count Date detected,

all give the correct number and in reagrd to dates in the correct format

nizamsha
Specialist II
Specialist II

count ({$< [Fault Cleared] = {"<=$(=Date( Max([Date Detected])))"}>} [Fault Cleared] )

swuehl
MVP
MVP

Next step would be to look at the full expression after the dollar sign expansion (e.g. by using a chart expression with no label, hovering over the label should show the evaluated expression then.

Sometime QV evaluates a date like DD/MM/YYYY as math expression (two divisions), which results in a very low number...

Try enclosing the date in single quotes:

=count ({$< [Fault Cleared] = {"<='$(=Max([Date Detected]))'" }>} [Fault Cleared] )

samuel_brierley
Creator
Creator
Author

Im sorry ive looked at every part of the formula and all seems to work and is in the same format but i simply cant get the expression to work, would you be prepared to have a look at it? I dont have the required permission to open what gets sent back but would be eternall ygrateful for inswtructions.

you an absolute star

Dropbox - V9.2.qvw

I completly understand if ur not willing to download it