Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Beginner question : Count when several data in a row

Hello, I'm currently stuck in my small project and I have a question:

I currently have those data:

FR

BEL

FR/ES

SP

GER

FR/BEL/GER

 

And I would love to make a table with all the countries on the left and the count for each on the right. I basically tried the "Count function" but it doesn't work when there is several counties on the same row.

Is it possible to do it?

 

Thank you!!

  • Hi Anonymous ,

     

    Please follow below steps to achive this:-

    1.Split your column like below:-

    output:-

     

     

    2. Now use Group By with countries

    3. Now click on Close and apply.

    Final Output:-

     

    Thanks,

    Samarth

4 Replies

  • truptis's avatar
    truptis
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous ,

    You can try this:

    Result =IF(country ="FR/ES", calculate(count(columnname), filter(tablename, country ="FR" || Country ="ES")), 
    IF(country ="FR/BEL/GR", calculate(count(columnname), filter(tablename, country ="FR" || Country ="GR"|| Country ="BEL"),IF(country ="FR",calculate(count(columnname), filter(tablename, country ="FR"), IF(country ="BEL",calculate(count(columnname), filter(tablename, country ="BEL"), IF(country ="SP",calculate(count(columnname), filter(tablename, country ="SP"), calculate(count(columnname), filter(tablename, country = "GR")))))

    Anonymous -> Please mark this as a solution if it helps you. Thank you.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello, thank you for your help! The problem I have with this solution is that I only put a sample of my data, there is way more, so it wouldn't be possible or way too long to write one by one.

      Sorry!!

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous ,

     

    Please follow below steps to achive this:-

    1.Split your column like below:-

    output:-

     

     

    2. Now use Group By with countries

    3. Now click on Close and apply.

    Final Output:-

     

    Thanks,

    Samarth

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you !! I didn't thought about it this way even tho it's so simple, I feel stupid... Thank you a lot !