Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to count all [DATA_LIMITE] that >= Today(), but my field are not in Date Format, so i tried with a more simple equacition (just equal), with "If "condition.
If (FLOOR([DATA_LIMITE])=FLOOR(TODAY()), TRUE,FALSE)
With this i got 'true' where need to be 'true', so i tried the same logic to set analysis and did not work like i expected.
I tried use that
COUNT(${<FLOOR(DATA_LIMITE)={"$(=FLOOR(TODAY()))"}>}DISTINCT OID_SYSTEM)
Thank you
you are right but it will be inside of curly braces
You cant put an expression on the LHS of a set expression qualifier
COUNT(${<FLOOR(DATA_LIMITE)={"$(=FLOOR(TODAY()))"}>}DISTINCT OID_SYSTEM)
So if DATA_LIMITE does not have a time component, then use
COUNT(${<DATA_LIMITE = {"$(=TODAY())"}>} DISTINCT OID_SYSTEM)
Not sure when you say that your field is not in date format, but if your if statement works then maybe
COUNT(${<DATA_LIMITE={">=$(=FLOOR(TODAY()))"}>}DISTINCT OID_SYSTEM)
(you can't use an expression on the left hand side of the comparison in set analysis, only fields)
If DATA_LIMIT does have a time component (generally not best practice), then you could use
COUNT(${<DATA_LIMITE = {">=$(=TODAY()) <$(=TODAY()+1)"}>} DISTINCT OID_SYSTEM)
Hi Jonathan, Thank you for your time
Not work still bring all OID_SISTEM (204 Distinct Elements)
Here an image of my data
If your code my KPI results is 204, the same of Count(OID_SYSTEM)
Hi Piet!
Thanks for your explanation about can use an expression on left hand side, i didnt know about that.
About your response, the result are the same as Count(OID_SYSTEM) 204, but the right result are 3.
I would say
COUNT({$<P(FLOOR(DATA_LIMITE))={$(FLOOR(TODAY()))}>}DISTINCT OID_SYSTEM)
or
COUNT({$<DISTINCT OID_SYSTEM=P(FLOOR([DATA_LIMITE])=FLOOR(TODAY())>}DISTINCT OID_SYSTEM)
I see two problems in the code
1 $ would be inside the {} like {$<>}
second as Piet said we can't use the expression on the left side of set analyses. (I am not sure with P() we can use or not so will give it a try and maybe you don't need "" and $ altogether)
Thanks
Hi Jahanzeb,
Not working too bro.
about the second problem you are right i didnt know about it, lesson to learn, about the first $ i believe that means the current selection, i could use $ or 1 or something like that