Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use devide operator between set analysis

Hi.

I'm trying to use "/" between to set analysis calculations but it doesent work, only get 0. But if i use "+","-" or "*" it works fine. It looks like this:


sum({$<Color={'Blue'},Length-={'UNKNOWN'}>} Duration_s)/3600 / sum({$<Length-={'UNKNOWN'}>} Duration_s)/3600

Any suggestions

1 Solution

Accepted Solutions
kaushalview
Partner - Creator II
Partner - Creator II

Hi,

Use proper Backet Like ().

(sum({$<Color={'Blue'},Length-={'UNKNOWN'}>} Duration_s)/3600)

/

(sum({$<Length-={'UNKNOWN'}>} Duration_s)/3600)

Regards

Kaushal Mehta

View solution in original post

5 Replies
swuehl
MVP
MVP

What two values do you get for the two single sum() expressions?

Are you displaying the result with an appropriate amount of decimal places?

bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

maybe there are missing brackets:

sum({$<Color={'Blue'},Length-={'UNKNOWN'}>} Duration_s)/3600 /

(sum({$<Length-={'UNKNOWN'}>} Duration_s)/3600 )

and if so you could avoid the /3600

sum({$<Color={'Blue'},Length-={'UNKNOWN'}>} Duration_s) /

(sum({$<Length-={'UNKNOWN'}>} Duration_s) )

kaushalview
Partner - Creator II
Partner - Creator II

Hi,

Use proper Backet Like ().

(sum({$<Color={'Blue'},Length-={'UNKNOWN'}>} Duration_s)/3600)

/

(sum({$<Length-={'UNKNOWN'}>} Duration_s)/3600)

Regards

Kaushal Mehta

Not applicable
Author

Yes, I think rather that the problem is about how to displaying the numbers.

The values for one month is 3615/232= 15,58189655172414

swuehl
MVP
MVP

So

sum({$<Color={'Blue'},Length-={'UNKNOWN'}>} Duration_s)

is larger than

sum({$<Length-={'UNKNOWN'}>} Duration_s)

(even there is an additional filter applied)?

Or are you actually calculating 232 / 3615 = 0.064

and displaying only integer / rounded values?