Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
VictorBoscaro
Contributor II
Contributor II

Dates in set expression

I have a table like this

VictorBoscaro_0-1622819473156.png

And I want to have a filter in my app that will have the name of the conselour (no_conselheiro) but when selected the filter will be by those dates. The dates will be in a variable, and the variable will be used to filter a card.

I have made a set expression that look like this:

=COUNT({1<ft_processos.dt_julgamento={'>=$(v_dt_inicio_mandato)'}>*<ft_processos.dt_julgamento={'<=$(v_dt_fim_mandato)'}>} ft_processos.nu_processo_sei)

The syntax is correct and the date is being captured by the variables, according to the image below

VictorBoscaro_1-1622819657363.png

But it is returning 0 instead of the number of process that were judged in this period. When I use IF instead of set analysis I get a result, but the result is the number of processes judged by the conselour, and I need the processes that were judged in that time frame.

Any help on how can I solve this?

1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

When using >= in set analysis, you need to use double-quotes " instead of single quotes.

=COUNT({1<ft_processos.dt_julgamento={">=$(v_dt_inicio_mandato)"}>*<ft_processos.dt_julgamento={"<=$(v_dt_fim_mandato)"}>} ft_processos.nu_processo_sei)

 

View solution in original post

2 Replies
GaryGiles
Specialist
Specialist

When using >= in set analysis, you need to use double-quotes " instead of single quotes.

=COUNT({1<ft_processos.dt_julgamento={">=$(v_dt_inicio_mandato)"}>*<ft_processos.dt_julgamento={"<=$(v_dt_fim_mandato)"}>} ft_processos.nu_processo_sei)

 

VictorBoscaro
Contributor II
Contributor II
Author

I got through this:

=COUNT({1} DISTINCT IF(dt_julgamento >= v_dt_inicio_mandato AND dt_julgamento <= v_dt_fim_mandato, ft_processos.nu_processo_sei))