Unfortunately I do not speak French well so I put your question into Google Translate. I hope that you will be able to do the same with my response
The attached Tableau file includes the filter that you're requesting. I called it "Hotel and Month Filter" - it returns a value of "Include" only if guests stayed at H1 in June or in H2 in September.
I dropped this onto the filter shelf, selected only the "Include" value, and created the following view.
Let me know if you have any questions.
Hotel Stays.twbx 35.0 KB
Pour compter distinctement les clients vous pouvez créer un champs calculé: COUNTD([Client])
Ensuite, vous pouvez poser en ligne l'hotel et le date d'entrée, ca devrait faire le compte comme vous le voulez
Thanks Paul (& Cédric).
After reading your answers, I think my question is incomplete.
I would like to allow my colleagues -who are not developers- to use the filter "Hotel" and "month (start of stay)" two times :
- The first time to select "H1" AND "6"
- The second time to select "H2" AND "9"
The result is the number disctinct of customer who response at the first first OR at the second test.
I join a montage for explication.
Thanks a lot (and sorry for my english !).
Merci Cédric (et Paul).
A la lecture de vos réponses, je me rends compte que je me suis mal exprimé.
Je voudrais permettre à un utilisateur de compter le nb de clients ayant séjourné dans l'hôtel H1 en Juin 2018 OU dans l'hôtel H2 en Septembre 2018, sans qu'il ait à programmer.
- Lui permettre de choisir "Hotel = H1" ET "Mois de séjour = 6"
- Puis "Hotel = H2" ET "Mois de séjour = 9"
- et enfin d'associer ces 2 filtres avec un OU
En résumé, est-ce possible de combiner des filtres comme le montage ci-dessous ?
Hi Didier, thank you for your detailed explanation. I believe I have it figured out now.
I created two sets of parameters - two sets of hotel and month stay selectors. I created a calculated field which checks the client's hotel and month of stay against both parameters and counts the clients that fit into either criteria.
Here's what the updated view looks like
The updated .twbx file is attached.
Hotel Stays.twbx 49.9 KB
I'm sorry for my late response.
Your explication is perfect, thanks !
I updgrade my question : I would to allow my colleagues to choice the variable to calculate the number disctinct of customer who response at the first first OR at the second test.
I do a test but the result is not correct... (file attached)
And I anticipe my next question : is it possible to allow my colleagues to choice OR ou AND to combine the variables ?
[Hotel (dynamic choice) IN "H1" (list of values) AND Month (dynamic choice) IN "6" (list of values)]
OR/AND (dynamic choice)
[Hotel (dynamic choice) IN "H2" (list of values) AND Month (dynamic choice) IN "9" (list of values)]
Thanks a lot !
Hotel Stays(2).twbx 18.2 KB
I reverted the calculation back to how I had it previously (using parameters for each input instead of filters). I then added a new parameter called "And/Or" that let's you switch the logic between And and Or - so looking for either people who stayed in both hotels in both months, or the combined number of people that stayed in each. Here's the updated formula I used for this:
Updates are in the attached .twbx file on the "Number of Clients" tab.
Hotel Stays.twbx 22.5 KB
Thanks a lot Paul, it's perfect !
Last question : I have tryed to replace "Hotel 1" by a Dimension named "Dimension 1" who allow to my colleagues to choice the variable to calculate the number disctinct of customer.
And, I don't kow why, the result is not correct (2 vs. 3 like expected result).
I join you my modification in the attached .twbx file on the "Number of Clients" tab, with dimension "Dimension 1" and parameter "Dim 1".
Again, thanks for your help, I learn a lot of things with your answers.
Hotel Stays(3).twbx 20.3 KB
Since your Dimension 1 value is a filter, that's going to override anything in the second set of parameters. So the way that it's currently set up, it's only looking at people who stayed in Hotel 1 (in either June or September - depending on the selection in the "Hotel 1 Month of Stay" parameter).
Because the view is filtered on Hotel 1, nothing for Hotel 2 is being evaluated, so the answer of 2 is correct in this case.
The way I'd set it up for you previously was with two parameters which is why they were able to work independently. We weren't filtering anything out with that method. This method does filter out values.