Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
bharatkishore
Creator III
Creator III

Expression

Hi All,

I have 2 fields Channel and Sales..

In channel i have A,B,C,D,E and in sales i have 10,20,30,40,50

Now my requirement is if i select a channel  for example i selected A and it is having value 10.. i need to get 10/10+20+30+40+50..

The same  for B.. 20/10+20+30+40+50 = 20/150..


Please help on this..


Thanks

Bharat

1 Solution

Accepted Solutions
Anonymous
Not applicable

if you are not using the expression in the chart then you need to ignore the filter for the denominator.

sum(Spend)/sum({<Channel =>}Spend)


use Bharat's expression in say a bar chart where the dimension is Channel. As indicated previously you should mark this as relative and probably also define the number format as %

View solution in original post

9 Replies
MK_QSL
MVP
MVP

SUM(Value)/SUM(Total Value)

bharatkishore
Creator III
Creator III
Author

Hi Manish,

Thanks for your reply..

I have given like this

=sum(Spend)/sum(TOTAL Spend)

But i am getting value as 1

Kushal_Chawda

Create the chart,

Dimension - channel

Expression - sum(sales)  (check relative option for this expression)

MK_QSL
MVP
MVP

Create a Chart/Table

Dimension

Channel


Expression

SUM(Value)/SUM(Total Value)

If you want in Text Box

You have to use

SUM({<Channel = {'A'}>}Value)/SUM(Total Value)

SUM({<Channel = {'B'}>}Value)/SUM(Total Value)

SUM({<Channel = {'C'}>}Value)/SUM(Total Value)

SUM({<Channel = {'D'}>}Value)/SUM(Total Value)

SUM({<Channel = {'E'}>}Value)/SUM(Total Value)


Anonymous
Not applicable

if you are not using the expression in the chart then you need to ignore the filter for the denominator.

sum(Spend)/sum({<Channel =>}Spend)


use Bharat's expression in say a bar chart where the dimension is Channel. As indicated previously you should mark this as relative and probably also define the number format as %

susovan
Partner - Specialist
Partner - Specialist

Hi Bharat,

Try this attachment,

23.JPG

Warm Regards,
Susovan
Anonymous
Not applicable

Hi,

use this expression :

NUM(SUM(Sales)/SUM(TOTAL Sales),'##.0000')

susovan
Partner - Specialist
Partner - Specialist

Hi Bharat,

You also try this expression,

Sum(TOTAL{<Field1=>} Field2)/Sum(Field2)


Warm Regards,
Susovan
bharatkishore
Creator III
Creator III
Author

Thanks Damian..This is exactly what i needed.