Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
stvn_003
Contributor III
Contributor III

Counting records before a date

Hello, I wonder what is the correct way to write this expression:

Count( {$<price_ok = {N} , date <= {Today()-7} >} pk_oc )

18 Replies
maxgro
MVP
MVP

post your doc, if possible

or remove the label of the expression with set analysis and you could see the expression as that in the image to check it

the format of the field and the format of the date must be the same

1.png

stvn_003
Contributor III
Contributor III
Author

considering the table of the previous exampleImagen1.png

ramoncova06
Specialist III
Specialist III

did you see my comment regarding the single quotes for ocd_precio_ok ?

stvn_003
Contributor III
Contributor III
Author

Yes, i try, but nothing changes

ramoncova06
Specialist III
Specialist III

so Count( {$<ocd_precio_ok = {'N'} >} ocd_cmtrlsap) and Count( {$<ocd_precio_ok = {N} >} ocd_cmtrlsap) gives you the same number ?

sunny_talwar

Try this may be this might give you the result you are looking for.

=Count( {$<ocd_precio_ok = {N}, occ_fentr = {"$(='<=' & Date(Today()-7,'DD/MM/YYYY'))"} >} ocd_cmtrlsap)

stvn_003
Contributor III
Contributor III
Author

Hi, here I upload a sample file so that they can understand better. Thanks for the support

Column should have all the records (6), but only column B that has a date (column C) above or equal to 08/05/2015 (4)

QV_duda.jpg

maxgro
MVP
MVP

maybe this

Count( {$<ocd_precio_ok = {N}, occ_fentr = {"<=$(=Date(Today()-6,'DD/MM/YYYY hh:m:ss tt'))"} >} ocd_cmtrlsap)

1.png

stvn_003
Contributor III
Contributor III
Author

Thank you very much Massimo, was just what I needed