script in formula in filter query
![UserBird](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar12.png)
UserBird
Dataiker, Alpha Tester Posts: 535 Dataiker
Problème rencontré lors d'une requête sur un champ string (filtre pour conserver uniquement des dossiers 2017)
slice("sdoss_numdoss",2,4)=="2017"
ou
substring("sdoss_numdoss",2,4)=="2017" (ou substring("sdoss_numdoss",1,4)=="2017" )
message en-dessous : "Formula is valid"
(structure du champ sdoss_numdoss = P201704160494SIA)
résultats --> 0 observation
slice("sdoss_numdoss",2,4)=="2017"
ou
substring("sdoss_numdoss",2,4)=="2017" (ou substring("sdoss_numdoss",1,4)=="2017" )
message en-dessous : "Formula is valid"
(structure du champ sdoss_numdoss = P201704160494SIA)
résultats --> 0 observation
Tagged:
Answers
-
You don't need quotation marks around the column name.
Also, you should try without the boolean test to see what the substring outputs.
Anyway, substring(sdoss_numdoss, 1, 5)=="2017" should work. -
i tested but it doesnt work
substring(sdoss_numdoss, 1, 5)=="2017"
and 0 result -
Did you try without the boolean test? See what the substring outputs?
-
mistake , last dataset wasnt update and was empty...
substring(sdoss_numdoss, 1, 5)=="2017" works !
thank you