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

IS THE EXPR CORRECT?

if(dir=abc,sum(usedspace)/sum({<=only({<dir={'abc'}>},totalspace)),0)

8 Replies
Not applicable
Author

Expression is not correct

its_anandrjs

No i assume dir holds the abc values then put single quotes for that

if(dir = 'abc', sum( usedspace ) / sum( {<=only( {<dir={'abc'} >} ,totalspace)) , 0 )

ashfaq_haseeb
Champion III
Champion III

Try like this

if(dir='abc',sum(usedspace)/sum({<=only({<dir={'abc'}>},totalspace)),0)


Regards

ASHFAQ

alexandros17
Partner - Champion III
Partner - Champion III

try this:

if(dir='abc',sum(usedspace)/sum({$ <only({<dir={'abc'}>},totalspace)),0)

Not applicable
Author

Try this

I think there should not b comma (,) before totalspace


if(dir=abc,sum(usedspace)/sum({<=only({<dir={'abc'}>} totalspace)),0)

Not applicable
Author

Not working

my actual requirements    if dir ='abc'  then output should be sum(usedspace)/850

here 850 is total space  if i go with 850 i am getting correct result that is static but i want as a dynamic

instead of 850 i want write condition .

if i go with simple sum(totalspace) then it is talking entire space ,i dont want like that

if dir =abc then need to calculate related to abc total space  i.e i written like above expression

ashfaq_haseeb
Champion III
Champion III

Hi,

It doesn't make sense.

Can you come-up with some sample data.

Then what does sum(usedspace) returns?

Regards

ASHFAQ

rubenmarin

Hi, maybe:

if(dir='abc',sum(usedspace)/only({<dir={'abc'}>} totalspace),0)