Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
maudifer
Contributor III
Contributor III

Dividing 2 expressions in Qlikview

Hi All,

I created the below expressions (EX1 and EX2)

Ex1: COUNT({<[MonthID1]={$(cCurrMonthID))},[Actual Dl vs Req. DL On Time]={'On Time'}>}[Container No.])

Ex2: COUNT({<[MonthID1]={$(cCurrMonthID)}>}[Container No.])

I want do Divide EX1 by Ex2: EX1/EX2. so i worte the below:

COUNT({<[MonthID1]={$(cCurrMonthID))},[Actual Dl vs Req. DL On Time]={'On Time'}>}[Container No.])/COUNT({<[MonthID1]={$(cCurrMonthID)}>}[Container No.])

But I always shows 1, as if the 2 numerical totals were the same, but it should give a result of 0.69

In reality, EX1 is equal to 65 and Ex2 is equal to 94.

Separately, the expressions work. They give me the right number. I tried adding or subtracting them, and it worked.

But when it comes to multiplying or dividing, it does not work at all.

I checked that it was rounded up too.

But i am stuck there.

any ideas ?

2 Replies
petter
Partner - Champion III
Partner - Champion III

Could you please tell us what you mean by "not working"? Do you get a dash - or 0 or a wrong number?

Where do you use the expression is it in a Straight Table or Pivot Table? Do you have a screenshot of the table with and without the division?

What are the dimensions you are using in conjuction with the expression? 

maudifer
Contributor III
Contributor III
Author

H Petter,

It was in a pivot table, and I fixed it

I realised i was using the field [Actual Dl vs Req. DL On Time] as a dimension too, and it made my expression calculate all counts from[Actual Dl vs Req. DL On Time] / all counts from [Actual Dl vs Req. DL On Time], which resulted in "1" (94/94).

but now it works.


thanks