Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
eduardo_dimperio
Specialist II
Specialist II

Set Analysis Issue

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

1 Solution

Accepted Solutions
zebhashmi
Specialist
Specialist

you are right but it will be inside of curly braces

View solution in original post

14 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
stigchel
Partner - Master
Partner - Master

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)

jonathandienst
Partner - Champion III
Partner - Champion III

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)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
eduardo_dimperio
Specialist II
Specialist II
Author

Hi Jonathan, Thank you for your time

Not work still bring all OID_SISTEM (204 Distinct Elements)

Here an image of my data

set_analysis.JPG

If your code my KPI results is 204, the same of Count(OID_SYSTEM)

eduardo_dimperio
Specialist II
Specialist II
Author

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.

zebhashmi
Specialist
Specialist

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)

zebhashmi
Specialist
Specialist

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

eduardo_dimperio
Specialist II
Specialist II
Author

Hi Jahanzeb,

Not working too bro.

eduardo_dimperio
Specialist II
Specialist II
Author

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