Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

gsteimer
New Contributor II

how to change a fixed date in a date YearMonth selected in a filter,set analysis date

I am a new user on Qlik

I have this script :

Count({$<[Début de contrat]={"<=31/08/2018"}>} total [Matricule facturation])

and I try this expression but it doesn't work :

Count({$<[Début de contrat]={"<=$(=[[date fin de mois.autoCalendar.YearMonth]])"}>} total [Matricule facturation])

thanks for help

4 Replies
Employee
Employee

Re: how to change a fixed date in a date YearMonth selected in a filter,set analysis date

Try

Count({$<[Début de contrat]={"<=$(=Date(Max([[date fin de mois.autoCalendar.YearMonth]])))"}>} total [Matricule facturation])

gsteimer
New Contributor II

Re: how to change a fixed date in a date YearMonth selected in a filter,set analysis date

It doesn't work

all my shet is base on this script.

I Don't want to replace the date in all the different graph.

So I imagine to use a field with the next end month date in a table

and selected the next date 30/09/2018 to Apply it

Employee
Employee

Re: how to change a fixed date in a date YearMonth selected in a filter,set analysis date

I am not sure I understand what you are trying to do... Are you using the expression in the Load script? Then it will not work - you cannot use set analysis there.

If you want to create an end-of-month date in the script you can use the following inside a Load statement:

  ...  ,

  [Début de contrat],

  MonthEnd([Début de contrat]) as [date fin de mois],

  ...

HIC

gsteimer
New Contributor II

Re: how to change a fixed date in a date YearMonth selected in a filter,set analysis date

I' trying to explain better

in my expression Count({$<[Début de contrat]={"<=31/08/2018"}>} total [Matricule facturation])

I replace 31/08/2018 by a variable [date reporting]=31/08/2018 and it's ok

is it possible to select this date in a filter  from a table  [date fin de mois]?

my table date is like that

Capture qlik.JPG