# Conditionals for timefield in Timelion

**URL:** https://discuss.elastic.co/t/conditionals-for-timefield-in-timelion/96375
**Category:** Kibana
**Tags:** timelion
**Created:** [August 9, 2017, 6:05am UTC](https://discuss.elastic.co/t/conditionals-for-timefield-in-timelion/96375 "2017-08-09T06:05:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sLuvpreet33](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sluvpreet33/32/50626_2.png) [@sLuvpreet33](https://discuss.elastic.co/u/sLuvpreet33)
#### Post date: [August 9, 2017, 6:05am UTC](https://discuss.elastic.co/t/conditionals-for-timefield-in-timelion/96375/1 "2017-08-09T06:05:18Z")

</div>

I have 4 different types in an index.

One type is booking, and one is User.

Booking has booking\_time as a timefield, and User has a date\_joined field as a timefield.

I want to draw bookings when User's date\_joined is greater than some date.

```
.es(index='prod-db', timefield='booking_time', q='_type:booking'), .es(index='prod-db', timefield='booking_time', q='_type:booking').if(gt,now-6d,.es(index='prod-db', q='_type:user', timefield='user_date_joined'))

```

I have tried this and this does not work for me. It says, **Timelion: Error: in cell #1: must be a number or a seriesList**

how can I achieve this ? How can I query conditionals on Timefields in Timelion?

---

<div class="post-metadata">

### Author: ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)
#### Post date: [August 9, 2017, 11:52pm UTC](https://discuss.elastic.co/t/conditionals-for-timefield-in-timelion/96375/2 "2017-08-09T23:52:07Z")

</div>

It sounds like you are trying to join the data from the bookings with the data from the users, but I'm pretty sure that's not possible even in Timelion. It sounds like you ultimately want to draw bookings, and you want to filter bookings based on the user's `date_joined` property. In order to do this you'll have to index this data together, like so:

```json
{ "index": { "_type": "booking" } }
{ "booking_time": "...", "users_date_joined": "...", ... other fields ... }

```

---

<div class="post-metadata">

### Author: ![sLuvpreet33](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sluvpreet33/32/50626_2.png) [@sLuvpreet33](https://discuss.elastic.co/u/sLuvpreet33)
#### Post date: [August 11, 2017, 8:36am UTC](https://discuss.elastic.co/t/conditionals-for-timefield-in-timelion/96375/3 "2017-08-11T08:36:12Z")

</div>

Hi @spalger ,

I have indexed the data as you have said. I have the `user_date_joined` in my index under booking type.

How should I put the conditionals now ?

Can you give an example ?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 8, 2017, 8:36am UTC](https://discuss.elastic.co/t/conditionals-for-timefield-in-timelion/96375/4 "2017-09-08T08:36:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
