# Tickscript get tags value size

**URL:** <https://community.influxdata.com/t/tickscript-get-tags-value-size/28970>\
**Category:** Kapacitor\
**Created:** [March 8, 2023, 8:48pm UTC](https://community.influxdata.com/t/tickscript-get-tags-value-size/28970 "2023-03-08T20:48:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan\_Xiuxiu](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dan_xiuxiu/32/12900_2.png) [@dan\_Xiuxiu](https://community.influxdata.com/u/dan_Xiuxiu)\
**Post date:** [March 8, 2023, 8:48pm UTC](https://community.influxdata.com/t/tickscript-get-tags-value-size/28970/1 "2023-03-08T20:48:42Z")

</div>

As influxdb you can use "SHOW TAG VALUES CARDINALITY ON “dbname” from "measurements “with key =“tagname”” to get how many values in this tag. what if get count of this tag value as variable in Tickscript.  
In the Chronograf shows like  
\* Measurements xxx  
\* tag1  
\* value1  
\* value2  
\* tag2  
and the count of tag1 is 2  
I know if I want to use query must use batch. what I need use stream. how to get this count “2” as variable  
stream  
|from()  
.database(‘test’)  
.retentionPolicy(‘autogen’)  
.measurement(‘pending\_queue\_size’)  
any suggestions

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [March 8, 2023, 10:11pm UTC](https://community.influxdata.com/t/tickscript-get-tags-value-size/28970/2 "2023-03-08T22:11:14Z")

</div>

Hello @dan_Xiuxiu,  
Welcome!  
Unfortunately Kapacitor is end of life. There isn’t any more engineering support for it anymore and I don’t know the answer.  
I recommend upgrading or using Cloud.  
Either using tasks or serverless function solution to run your own tasks.  
OSS:

> **[Explore your data schema with Flux | InfluxDB Cloud Documentation](https://docs.influxdata.com/influxdb/v2.6/query-data/flux/explore-schema/)**
>
> Flux provides functions that let you explore the structure and schema of your data stored in InfluxDB.

> **[Get started with InfluxDB tasks | InfluxDB Cloud Documentation](https://docs.influxdata.com/influxdb/v2.6/process-data/get-started/)**
>
> Learn the basics of writing an InfluxDB task that processes data, and then performs an action, such as storing the modified data in a new bucket or sending an alert.

Cloud:

> **[TL;DR InfluxDB Tech Tips: Downsampling with Flight SQL and AWS Lambda](https://www.influxdata.com/blog/tldr-influxdb-tech-tips-downsampling-flight-sql-aws-lambda/)**
>
> This tutorial covers how to perform downsampling with the new #InfluxDB storage engine, InfluxDB IOx, in InfluxDB Cloud (available on AWS us-east-1 and AWS eu-central-1 starting February 1st) using AWS Lambda.
