Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
Serial | Date | Price |
---|---|---|
123 | 01-01-2013 | 5 |
234 | 02-02-2013 | 6 |
345 | 02-02-2013 | 7 |
123 | 04-05-2013 | 8 |
and use function:
count({<Date={'<=$(currentDate)'}>}Date)
i would expect following result:
currentDate | count({<Date={'$(currentDate)'}>}Date) |
---|---|
01-01-2013 | 1 |
... | 1 |
02-02-2013 | 3 |
... | 3 |
03-03-2013 | 3 |
... | 3 |
04-05-2013 | 4 |
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
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
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?
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
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