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: 
Anonymous
Not applicable

Count of records

Hi all

Below is my script trying to find the count of  records between the dates .

Test:

load

count(RecNo()) as countRec

FROM

[$(MyPath_Int)\SALES.QVD]

(qvd)

where num(SALESDATE) >= $(START_DATE) and num(SALESDATE) <= $(END_DATE);

is it correct syntax and logi to get count of records

Please correct me if i am wrong with the script.

6 Replies
Anonymous
Not applicable
Author

are you getting any error ...what you are trying to do .. it looks correct.

Thanks

BKC

danieloberbilli
Specialist II
Specialist II

try it with a group by at the end:

Test:

load

SALESDATE,

count(RecNo()) as countRec

FROM

[$(MyPath_Int)\SALES.QVD]

(qvd)

where num(SALESDATE) >= $(START_DATE) and num(SALESDATE) <= $(END_DATE)

Group By SALESDATE;

tresesco
MVP
MVP

Use RowNo() instead of recno(). Count migth not be necessary here. Try like:

Load

          RowNo() as Count

From ....;

Now maximum of the count will give you the no of records.

PrashantSangle

Hi,

Can you post complete script with

How you set Variable START_DATE and END_DATE

and format of SALESDATE

It is guess

I think there is problem in Num(SALESDATE)

try with Num(Date#(SALESDATE,YourFormat)) instead of only writing num(SALESDATE)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

HI

Thanks for reply

Let END_DATE = num(Date(Today()-$(FCT_SALES_F),'DD/MM/YYYY'));

LET START_DATE =num(MakeDate(Year(today()) -1));

Anonymous
Not applicable
Author

when i am executing the script it is not throwing any error or not populating any data but time is running

Thanks