# App Development

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for
Did you mean:
Contributor II

## How to do this? Round Inside Set Analysis

Hi!

I have 3 options in this post, 2 works as expected and 1 does not.

1) THIS WORKS AND DOES NOT RESPECT THE FILTER APPLIED BY THE USER (OK ITS IS CORRECT)

In the graph:

sum(
{1}
if(
([Rev Prc - Rms Envia]=0 and round([Rev Prc - Mrg Real Var],0.01)<round([Rev Prc - Mrg Cad Var],0.01))
,1,0 )
)

2) THIS WORKS DOES NOT RESPECT THE FILTER APPLIED BY THE USER (OK ITS IS CORRECT)

In the graph:

count(
{1<
[Rev Prc - Rms Envia]={0}
,Rev Prc - Mrg Real Var] = {"<[Rev Prc - Mrg Cad Var]"}
>}
[Rev Prc - RowID]
)

Round In the editor:

num([Rev Prc - Mrg Real Var],'#.00') as "Rev Prc - Mrg Real Var",
num([Rev Prc - Mrg Cad Var],'#.00') as "Rev Prc - Mrg Cad Var",

3) THIS WORKS TO COUNT CORRECTLY EXCEPT IT DOES RESPECT THE FILTER APPLIED BY THE USER (SHOULD NOT)

count(
{1<
[Rev Prc - Rms Envia]={0}
,[Rev Prc - RowID] = {"=round([Rev Prc - Mrg Real Var],0.01)<round([Rev Prc - Mrg Cad Var],0.01)"}
>}
[Rev Prc - RowID]
)

The problem with the filter is in this line

,[Rev Prc - RowID] = {"=round([Rev Prc - Mrg Real Var],0.01)<round([Rev Prc - Mrg Cad Var],0.01)"}

But it does work and count correctly.

I would like to know if there is a way to do it using the option 3.

Option 1 ok.

Option 2 ok. but I need to create more columns in the editor.

Option 3 works but does respect the filter (should not).

Thanks!

Bruno

1 Solution

Accepted Solutions
MVP

May be try this

``Count({1<[Rev Prc - Rms Envia] = {0}, [Rev Prc - RowID] = {"=Only({1} Round([Rev Prc - Mrg Real Var], 0.01) < Round([Rev Prc - Mrg Cad Var], 0.01))"}>} [Rev Prc - RowID])``

2 Replies
MVP

May be try this

``Count({1<[Rev Prc - Rms Envia] = {0}, [Rev Prc - RowID] = {"=Only({1} Round([Rev Prc - Mrg Real Var], 0.01) < Round([Rev Prc - Mrg Cad Var], 0.01))"}>} [Rev Prc - RowID])``

Contributor II
Author

It worked sunny_talwar!!

Thank you!!

Bruno