# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for
Did you mean:
Contributor II

## Count Same Values from Two Columns

I am trying to Count Values from two Columns in Table-1 and have to display in a chart as Table-2

Association of Characters with IN or OUT is not working for me.

Is there any other-way through Set-Analysis to obtain the output as shown in the second table.

Chart function is highly appreciated.

Regards,

Labels (8)

• ### Set Analysis Expression

1 Solution

Accepted Solutions
Partner

Not sure if it’s the ideal solution, but you could use a ValueList for the dimension:

Valuelist(‘A’,‘B’,’C’,’D’)

and in the expression for the Count In:

Pick(Match(Valuelist(‘A’,‘B’,’C’,’D’),‘A’,‘B’,’C’,’D’),

Count({<IN={‘A’}>}ID),

Count({<IN={‘B’}>}ID),

Count({<IN={‘C’}>}ID),

Count({<IN={‘D’}>}ID)

)

and for the out, change the Set Analysis accordingly.

I haven’t done this in a long time, so not completely sure it will work, and it is a dirty solution.

Hope it helps 😉

Regards

3 Replies
Partner

Not sure if it’s the ideal solution, but you could use a ValueList for the dimension:

Valuelist(‘A’,‘B’,’C’,’D’)

and in the expression for the Count In:

Pick(Match(Valuelist(‘A’,‘B’,’C’,’D’),‘A’,‘B’,’C’,’D’),

Count({<IN={‘A’}>}ID),

Count({<IN={‘B’}>}ID),

Count({<IN={‘C’}>}ID),

Count({<IN={‘D’}>}ID)

)

and for the out, change the Set Analysis accordingly.

I haven’t done this in a long time, so not completely sure it will work, and it is a dirty solution.

Hope it helps 😉

Regards

Partner

Hey @zulfikar_syed ,

Did it work?

If so mark the answer as SOLVED.

Thank you 😉

Contributor II
Author

hi @jberna26 , Thank you for the solution.. I apologize for this late reply.. Currently I am working on your solution, as my chart has more than one dimension in the same table and More values in the ValueList. Please give me some time as I am implementing it and will mark as solution once I tested. I am sure this is the only solution.

I appreciate your help and I promise I will mark your reply as a solution once I tested it. And I will also post a reply if there is any other alternate work around for this problem..

Regards,