Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rachelpurple
Partner - Contributor III
Partner - Contributor III

How to Calculate one field against the a value in other field

Hi,

Say I have table like this.

HostEventProposed Event
1A
2A
3AA
4AA
5B
6BB
7C
8CC
9CC
10DD
11DD

I want to create a bar chart having Event and Proposed Even as x-Axis, count of Host as y-Axis, so it will show

A Proposed: 4

A Event: 2

B Proposed: 2

B Event: 1

C Proposed: 3

C Event: 2

D Proposed: 2

D Event: 2

I now have Proposed Event as my dimension, and how to build the expression to realise this?

Guess this is to do with calculate Host field against the value in Proposed Event and in Event respectively?

Thanks,

Luda

1 Solution

Accepted Solutions
sunny_talwar

Like this?

Capture.PNG

Dimension

Proposed Event

Expressions

=Count({<Host = {"=Len(Trim([Proposed Event])) > 0"}>} Host)

=Count({<Host = {"=Len(Trim(Event)) > 0"}>}Host)

View solution in original post

5 Replies
sunny_talwar

Like this?

Capture.PNG

Dimension

Proposed Event

Expressions

=Count({<Host = {"=Len(Trim([Proposed Event])) > 0"}>} Host)

=Count({<Host = {"=Len(Trim(Event)) > 0"}>}Host)

rachelpurple
Partner - Contributor III
Partner - Contributor III
Author

Thanks a lot. I believe it should work

However, actually my table is like this:

HostEventProposed Event
1EA
2FA
3AA
4AA
5EB
6BB
7EC
8CC
9CC
10DD
11D

D

So I tried your expression it doesn't work on mine.

Just that I need to change anything in Event but not in Proposed Event to "0" or Blank first.

Do you know how to change that? or if you know how to realise the chart without changing this?

sunny_talwar

May be this for Event:

=Count({<Host = {"=Event = [Proposed Event]" }>}Host)

rachelpurple
Partner - Contributor III
Partner - Contributor III
Author

Thanks very much Sunny,

This works!

sunny_talwar

Awesome

Please close this thread by marking correct answer.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny