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: 
Not applicable

Multiplying two fields in a expression!

Hi

Imagine if Date is there are as a dimension in line chart and I want some to have some below in the expression. Is it possible?


Sales * Count(ID) //Where Sales and ID are the fields.


I tried something same like above but it is not giving any value. Is there is anyother way of doing it please.

Hope some can help me out.

47 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use = X * Count(Persons) as Expression

          Or

     If your using Count of Persons as Expression not a dimension then u can use this also

          = X * Column(1)

Hope this is you need

Celambarasan

Not applicable
Author

Thank you both Kaushik & Celambarasan.

But actually the problem is not as simple as i've made it look.

Actually i've two more dimensions D  & E ,the actual table is like below:

D          E           X        

-------------------------------------------

a          p           0

a          q           0.5

a          r            1

b          p            1

b          r           1

c          p          0.5

d          q           0.5

Now i want a pivot table with d as 1st dimension,E as 2nd dimension with expr1 as count in each E(no of persons which is simple & the 2nd expr as sum(no. of persons in each E multiply by X)

I think aggr shud be for 2nd expr: sum(aggr(count(Name),X))............but i'm committing a istake somewhere.

Plz help

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the example attched.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thanks again,

But actually Kaushik i u just replace the q in the 2nd row in the 2nd col. of the inline table by p, which is the actual scenario

D, E, X
a, p, 0
a, p, 0.5
a, r, 1
b, p, 1
b, r, 1
c, p, 0.5
d, q, 0.5
]

 

;

then the we have 2 persons in E, from which 1 is having 0 & other 0.5,so although the 1st expr shud show 2 the 2nd shud show (1*0+1*0.5)=0.5 which is not the case.

Finally i've reached to the complete problem.

Plz reply

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the attched example.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi, Thanks again for the reply

Actually i want the expr to be X* count(distinct E) and when i add X also as 3rd dim. & set show partial sums for each dim....then althogh sum of count(E) is correct, sum of x*count(distinct E) is null only for 1st row interestingly

plz help once more

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     I am not getting, can you explain with example.

Regards,

Kaushik Solanki   

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

i've modified ur qlikview file.....dnt know how to attach it to msg.

have attached the screenshot instead

plz help me in this......

qv.jpg

Not applicable
Author

any luck Kaushik ??

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     This problem is because you have choose the Expression total option in the Properties-->Expression tab-->Unter the total mode you have 3 options.

     Select sum of rows option to solve your problem.

Celambarasan