# Analytics that uses different columns in Tulip Table

**URL:** <https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141>\
**Category:** Support, Troubleshooting, & Help\
**Created:** [March 17, 2021, 11:33am UTC](https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141 "2021-03-17T11:33:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andres](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Andres](https://community.tulip.co/u/Andres)\
**Post date:** [March 17, 2021, 11:33am UTC](https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141/1 "2021-03-17T11:33:30Z")

</div>

I am building analytics for my first Tulip app and I am looking for a way to sum the same strings in different columns for my analytics. Here is an illustration of what I want to do:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/7/721f8cd74c3f32467ef625aba8558031fafe3c81.png)

Can I do it without building extra columns for counting strings?

---

<div class="post-metadata">

**Author:** ![gio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/gio/32/82_2.png) [@gio](https://community.tulip.co/u/gio)\
**Post date:** [March 17, 2021, 12:21pm UTC](https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141/2 "2021-03-17T12:21:42Z")

</div>

hello @Andres , thanks for posting!!

just to confirm, you you like for each record to count as 1 or for each individual test to count as 1??

you can do this by using the Expression Editor and adding multiple COUNT() Functions. Expression: `count(@Column 1 = 'Test 1') + count(@Column 2 = 'Test 1') + count(@Column 3 = 'Test 1')`

 ![Screen Shot 2](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/8/82d9c4ebba72c5008c5d101b4bafcfb20fab82ad.jpeg)

completions:

 ![Screen Shot 3](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/b/bfb7390ef3d0061dcd286450821683b21c976ac5.jpeg)

if you’d like for individual records that contain “Test 1”, you should be able to use count\_where\_true(). let me know if you need help building that out!!

---

<div class="post-metadata">

**Author:** ![Andres](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Andres](https://community.tulip.co/u/Andres)\
**Post date:** [March 17, 2021, 2:15pm UTC](https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141/3 "2021-03-17T14:15:10Z")

</div>

I am also looking for a way to show that data as a bar chart. The X-axis should show the different options in cells (in my example Test1, Test2, Test3, etc.).

I tried out the count function in the expression editor, but in my case, the data in my completions or in my table doesn’t match with what the analytics builder shows me.

It would be great if you can help to build that out.

---

<div class="post-metadata">

**Author:** ![gio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/gio/32/82_2.png) [@gio](https://community.tulip.co/u/gio)\
**Post date:** [March 17, 2021, 4:50pm UTC](https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141/4 "2021-03-17T16:50:28Z")

</div>

hello @Andres, we can certainly help out!!

could you share a screenshot of the Completions and of the Analytic you’re building??

based on what Im understanding, here is one way you could build it (and adding the remainder for Column 2, and 3):

 ![Screen Shot](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/a/a3583d3166e3c3393151a4da253e70947def5c7c.jpeg)

---

<div class="post-metadata">

**Author:** ![Andres](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Andres](https://community.tulip.co/u/Andres)\
**Post date:** [March 23, 2021, 9:07am UTC](https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141/5 "2021-03-23T09:07:31Z")

</div>

I think I got little bit closer with the solution.

This is what I got at the moment:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/0/0cda8eadb3f2a55d1db1355d9d459bce7e60529a.png)

There is still one error to solve before I can say it is solved - analytics doesn’t count the string when it is more than once on a same row. I need it to be taken into account.

I am basically looking the same solution as COUNTIF() function in Excel. Can you send me an example how can I use COUNT() function with matching strings in Expression editor. I haven’t found a solution for that.

Or can I use the app editor to count the number of matching values in Tulip table and store it to another column?

---

<div class="post-metadata">

**Author:** ![Andres](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Andres](https://community.tulip.co/u/Andres)\
**Post date:** [March 23, 2021, 11:09am UTC](https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141/6 "2021-03-23T11:09:37Z")

</div>

I tried another way also:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/d/d3a67d1d737040116c56552f7e10974feca71fee.png)

This gives me a correct data but the labels of the columns (bars) are wrong. Is there a way to change the labels under the columns on chart?

---

<div class="post-metadata">

**Author:** ![gio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/gio/32/82_2.png) [@gio](https://community.tulip.co/u/gio)\
**Post date:** [March 23, 2021, 1:38pm UTC](https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141/7 "2021-03-23T13:38:25Z")

</div>

hello @Andres!!

great to see you’re making good progress on the Analytics. to update the column labels, enter them here (optionally changing the color too) and click save:

 ![d3a67d1d737040116c56552f7e10974feca71fee](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/8/86eec545a599426a032b6a0f19720d0fbdb05149.png)

regarding your other question, have you using the `count(@Column 1 = 'Test 1')` as you mention?? this should return the number you’re looking:

 ![Screen Shot 1](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/1/11be7a9a0e0c7fb73d808ae351f2208ab065b019.jpeg)  
note the 2x `Test 1`:  
 ![Screen Shot 2](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/d/d1fe019e749b0b4a0bd87cad7af60fcddf3f5c24.jpeg)

let us know if this helps!!

---

<div class="post-metadata">

**Author:** ![Andres](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Andres](https://community.tulip.co/u/Andres)\
**Post date:** [March 23, 2021, 2:39pm UTC](https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141/8 "2021-03-23T14:39:42Z")

</div>

I got the correct column names but color change doesn’t work. After choosing color and clicking save nothing happens.

Count function also doesn’t work properly. I just tried it out as you showed. Mostly I got the count of completions right but with one data point it didn’t work - I tried it many times and all values from my dataset.

Is it possible to provide some test function to expression editor to test some parts of it?

---

<div class="post-metadata">

**Author:** ![gio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/gio/32/82_2.png) [@gio](https://community.tulip.co/u/gio)\
**Post date:** [March 23, 2021, 4:06pm UTC](https://community.tulip.co/t/analytics-that-uses-different-columns-in-tulip-table/2141/9 "2021-03-23T16:06:58Z")

</div>

hello @Andres,

just to confirm, are you clicking Save on the labels prior to saving the entire Analysis?? this is what it should look like:

 ![Screen Shot](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/b/b4c70c6f7a6c534e2c022502c5ec3cb79ea4adfe.jpeg)

if that is indeed the case, could you email [support@tulip.co](mailto:support@tulip.co) the link to the analysis??

regarding the COUNT() function, can you share a screenshot of the Expression you’re using and the Completions tab on your app??

thanks!!
