Is it possible to save the resulted data of a stream in two independent variables?

Now I have:

var total_hits =
stream
	|from()
		.database('stats_prv')
		.retentionPolicy('xtgpolicy')
		.measurement('hotel_avail')
		.groupBy('hus', 'hpr')
	|window()
		.period(5m)
		.every(1m)

var timeout_errors =
stream
	|from()
		.database('stats_prv')
		.retentionPolicy('xtgpolicy')
		.measurement('hotel_avail')
		.where(lambda: "et" == 'Communication_error')
		.groupBy('hus', 'hpr')
	|window()
		.period(5m)
		.every(1m)

But I would like something like:

var total_hits =
stream
	|from()
		.database('stats_prv')
		.retentionPolicy('xtgpolicy')
		.measurement('hotel_avail')
		.groupBy('hus', 'hpr')
	|window()
		.period(5m)
		.every(1m)

var timeout_errors =
total_hits
	|where(lambda: "et" == 'Communication_error')
	|sum('hit')
		.as('hits')

total_hits
	|sum('hit')
		.as('hits')

But with that code I’m not able to get what I want.

Is it possible to save the obtained data of a stream in two independent variables where one variable will have all the data and the other one only part of that data?

Thank in advance and best regards,
Msrcos.

Your second script looks accurate, can you provide more details with example data as to what is not working as expected?

After the code of the second script I tried to do:

total_hits
        |join(timeout_errors)
                .as('totals','timeouts')
                .tolerance(5m)
        |eval(lambda: int(float("timeouts.hits"/"totals.hits")*100.0), lambda: "timeouts.hits", lambda: "totals.hits")
                .as('rate', 'fail', 'hits')

And an error happens when I try to enable the alert:

enabling task testTimeout: cannot add child mismatched edges: sum4:stream -> join7:batch