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

Count({<Date={'<=$currentDate)'}>}Date) doesn't return correct number?!

Hallo!

I'm running in some issue while using the count-function.

Like header shows i want to count dates, wich are smaller(before) the currentDate.

CurrentDate is a variable and changes.

But the function always returns the wrong(for me, maybe function is working correct) number...

If i have this table:

SerialDatePrice
12301-01-20135
23402-02-20136
34502-02-20137
12304-05-20138

and use function:

count({<Date={'<=$(currentDate)'}>}Date)

i would expect following result:

currentDatecount({<Date={'$(currentDate)'}>}Date)
01-01-20131
...1
02-02-20133
...3
03-03-20133
...3
04-05-20134

But its not:(

If i check using FieldValue('Date',count({<Date={'<=$(currentDate)'}>}Date)) it returns wrong date.

It's much more in future, means the count-function returns a too big value...

Example:

currentDate = 23-01-2013

count({<Date={'<=$(currentDate)'}>}Date)=3

FieldValue('Date',count({<Date={'<=$(currentDate)'}>}Date))=03-03-2013                    (not always 2 days later, i didnt find an order)

Seems like i do not understand how the function works^^

What is wrong?

Thanks for reading,

Sarah

'Count({<Date={'$currentDate)'}>}Date)'  adjusted to 'Count({<Date={'<=$currentDate)'}>}Date)', after friendly hint from Joerg Hildebrandt

13 Replies
Not applicable
Author

maybe you got the same date twice and it add them. Therefore you get too many.. I dont know, its hard to say without dataset

Not applicable
Author

In the end the only explanation can be that i have duplicated rows in my table...

Wich are not shown in my table box and i dont know why^^

Does tableBox supresses duplicated rows?

Has QV the ability to save equal rows in one table?

IAMDV
Luminary Alumni
Luminary Alumni

Hi Sarah,

Use the List Box with frequency property checked to see if you have duplicate values. Table Box would show duplicates if you add unique key or all field in to Table Box. But be careful with Key Fields …they would make it inconsistent.

Cheers,

DV

www.QlikShare.com

Not applicable
Author

Oh you are so great:)

A lot of thanks to all of u!

I have duplicated dates, but thats ok because different serial_no can occurre a the same date.

Thats why distinct confuses me here...i want all dates,normally^^

Only problem i see is when whole rows in my table are equal(means every value).

Is this possible corresponding to QV?

QV doesn't allows me to copy tables by loading them like : load * resident table;

I'm so confused