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
Ok, strange to say but a missing distinct was the problem...
If i use count({<Date={'<=$(currentDate)'}>}distinct Date) it is like expected...
But how makes this sense?
If you change to count({<Date={'<=$(currentDate)'}>}Date)
this gives you the # of dates up to the date in the variable.
Works for me.
best regards
Joerg
Yea you're right, but i also tried <= 😕
Anyway thank u!
And no, it dont returns the correct value...
I will cahnge the original post^^
I use this function so many times before, but this time its not working...
I realy doont know whats wrong:-(
Can you post sample data ?
scrabmle your data under document properties and reduce data - Can you share then?
Otherwise, make ur data a numeric. And then count the difference between today and the date, then you will get the count of days
What is that scramble good for?
Does it make the data anonymous?
Another fact that i found is, that the higher the result is, the higher is the failure.
Means if i expected 8 its 10,if i expect 18 its 24....
And its not the numeric difference between "Today" and start, because sometime more than one serial_no occurres per day.
And somedays nothing occurres...
scramble makes your data into nonsense. This means we cannot interpret anything from your dataset because its been manipulated.
Hm, i cant see any difference but for more decimals?
And this project is much too big and includes data wich is much to sensitive...
I fear my company wouldn't agree...
I always check my data while creating some table boxes.
If i count the days "per hand" i see it returns the wrong result...
Is there any possiblity that a table box doesn't shows whole data(no supress zero ect. is deactivated)?
If u know some technology's to proof i can do anything^^
It seems like my understanding of count-function is well, maybe some issue's in data?
Ok, strange to say but a missing distinct was the problem...
If i use count({<Date={'<=$(currentDate)'}>}distinct Date) it is like expected...
But how makes this sense?