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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

multiplication in two tables linked with key

Dear Ladies and Gentleman,

I'm searching for a solution regarding the problem following:

2 Tables:

TABLE RATIOS:

KEY, Factor, Type

TABLE VALUES:

KEY, Value,

In Table Ratios with have a couple of values with different Types.

Example:

Type Factor

A 1

B 5

C 8

I just want to multiply Value in Talbe Values where Type in Table Ratios is C.

How does the Expression look like in a Chart or table?

Thank you for your help in advance.

1 Solution

Accepted Solutions
renjithpl
Specialist
Specialist

HI,

How about the below code,

sum (if(Type='C', Value))*sum(Factor)

Regards

View solution in original post

5 Replies
Not applicable
Author

Hello,

there are more than one possibility to arrage that, during loading or in chart or in another object or in a variable. So what do you want to do with the result (product) ?

Regards, Roland

Not applicable
Author

Thanks for your reply.

To getting more prescise on this, I want to do the following:

I need to mulitply the Value with the Factors, showing them in a pivot chart.

Product, Year, Segment, Region, Country, Revenue, Revenue(Value)*Factor(but only where Factor is Type C)

A001 2009 S99 EMEA France 1500 1500*5=7500

...

renjithpl
Specialist
Specialist

HI,

How about the below code,

sum (if(Type='C', Value))*sum(Factor)

Regards

Not applicable
Author

Ok Die,

here is my suggestion: I assume you have a Pivot Table Chart . There you can create an expression as follows:


if (Type= 'C', [Revenue]*Factor, [Revenue])


Hint: [Revenue] is the column-name of the chart, Revenue is the name of the (table-)field --> depends on you, what you want

Regards, Roland

Not applicable
Author

Thanks a lot.

Focusing a lot on Set Analysis made me too confused with such a simple thing.