# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save \$300 before February 6: REGISTER NOW!
cancel
Showing results for
Did you mean:
Contributor III

## Filter [saison/date]

Hola a todos

Tengo un problema al filtrar datos.

Tengo un Filtro con la siguiente condición:

=If(Right([Saison / Jahr], 4)>= Year(Today())-4 and Right([Saison / Jahr], 4)<= Year(Today())+1 and ([Saison]=1 or [Saison]=2), [Saison / Jahr])

--------------

=[Saison / Jahr]

Cuando lo uso el filtro el KPI me devuelve 0 pero cuando no lo utilizo me devuelve datos.

Por que puede ser ?? Gracias anticipadas.

Filter con Formula

=If(Right([Saison / Jahr], 4)>= Year(Today())-4 and Right([Saison / Jahr], 4)<= Year(Today())+1 and ([Saison]=1 or [Saison]=2), [Saison / Jahr])

Filter not Formula

=[Saison / Jahr]

Formula del KPI

7 Replies
Partner - Creator III

Hello R Mendoza,

This may be a small thing but did you try applying your filter like this:

=Date(If(Right([Saison / Jahr], 4)>= Year(Today())-4 and Right([Saison / Jahr], 4)<= Year(Today())+1 and ([Saison]=1 or [Saison]=2), [Saison / Jahr]) , 'M / YYYY')

And set expression like this:

SUM({<..., [Saison / Jahr]  = {"\$(=vSaison_JahrVG)"}>} {#Stuck Auftag])

I hope that helps!

Kind regards,

S.T,

Contributor III
Author

Hello @Stoyan_Terziev

I made the changes but the filter doesn't work.

[Saison / Jahr] =

Saison is only 1 and 2

and Jahr is only has the year.

LG,

Renzo

Partner - Creator III

Can you please troubleshoot by manually replacing the variable with the value you expect to get from it?

Something like:

Sum({<... [Saison / Jahr] ={"1 / 2019"}>} ...)

If this doesn't work, the problem may be somewhere else (like in the [Saison / Jahr] filed for example).

And if it works, than we need to do make sure the data type of the variable output is the same as the data type of the [Saison / Jahr] field.

Regards,

S.T.

Contributor III
Author

as soon as I use the filter it is set to 0

Partner - Creator III

Hi R Mendoza,

There may be a much quicker and more elegant solution that that one, but let's try something simple.

If the Filter Saison is based on an actual field, can you add this to your set expression:

Sum({<... [Saison / Jahr] ={"1 / 2019"}, Saison=>} ...)

If it is not, you can move the calculation behind this field to the back end and do this:

Sum({<... [Saison / Jahr] ={"1 / 2019"}, NewBackendSaison=>} ...)

I hope that helps!

Kind regards,
S.T.

Contributor III
Author

Hello @Stoyan_Terziev
I tried ... but it still doesn't work.

It is very strange because it only happens when I write the expression in the filter.

Contributor III
Author

Hi everyone,
I continue without finding the solution ... Any ideas.

Tags
Community Browser