Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
R_Mendoza
New Contributor

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 FormulaFilter 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 FormulaFilter not Formula

=[Saison / Jahr] 

Formula del KPIFormula del KPI

 
7 Replies
Highlighted
Partner
Partner

Re: Filter [saison/date]

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,

Highlighted
R_Mendoza
New Contributor

Re: Filter [saison/date]

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

Highlighted
Partner
Partner

Re: Filter [saison/date]

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.

Highlighted
R_Mendoza
New Contributor

Re: Filter [saison/date]

image.pngimage.png

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

Highlighted
Partner
Partner

Re: Filter [saison/date]

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.

Highlighted
R_Mendoza
New Contributor

Re: Filter [saison/date]

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.

Highlighted
R_Mendoza
New Contributor

Re: Filter [saison/date]

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