Skip to main content
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
maneshkhottcpl
Partner - Creator III
Partner - Creator III

Hi,

Please check.

Not applicable
Author

Hi Manesh

Thanks! Thats a Great Job! You have shown that it is possible to achieve that in many other ways.

maneshkhottcpl
Partner - Creator III
Partner - Creator III

Hi Attitude,

My trick is useful to u or not?

Not applicable
Author

Thanks Manesh! Yes your tip has helped me!

By the way I have one issue which is more or less exactly the same way like this. Hope you can help me out there as well.

Below expression I use in on my chart. What I want is I want to use "count(ID) * SALES" instead of "ID". But id didn't work! Do you have any idea about it please.


=count(distinct(if(len(DATE)>0,ID)))




Not applicable
Author

Hi Manesh

Have you got any idea on achieving the same? If yes please share it with me.

maneshkhottcpl
Partner - Creator III
Partner - Creator III

Hi,

Please try this. and let me inform its working or not.

=count(distinct(if(len(trim(DATE))>0,ID)))

Not applicable
Author

Thanks Manesh

Thats ok! But my question was you need to pass "count(ID) * SALES" instead of "ID". That is very important here!

Not applicable
Author

I want to do something like below. Hope it is understandable now!


=count(distinct(if(len(DATE)>0,count(ID) * SALES)))


Not applicable
Author

Hi all,

Plz help me on this,

i've a table

X            Persons      

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

0            A

0.5         B         

0.5         C

1            D

1            E

This means no. of Persons in Category 0: 1, in category 0.5 : 2 & in category 1: 2

So, i want a Qlikview table showing X as a dimension & expressions as No. of persons in each(which can be simply done by count(Persons)). The problem is the third col which should show the product of these two

X  Count(Persons)            Multiply

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

0          1                            0

0.5       2                            1

  1         2                            2

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     You can create a straight table with dimension as X and first expression as Count(Persons) and label this as Count

     Add another expression as X * Count

     Also find the sample application attached.

Regards,

Kaushik Solanki

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