Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
bobbydave
Creator III
Creator III

What values are my countries?

if(fabs((sum([Record Count]) - rangeavg(after(sum([Record Count]),1,6)))

        / rangeavg(after(sum([Record Count]),1,6)))

  > Threshold OR sum([Record Count])=0,1,0)

I have the above expression which gives me a true or false value (1,0)

What I now want to do is for the true values, to give me the countries.

I would have assumed a little set analysis

=Sum({<

if(fabs((sum([Record Count]) - rangeavg(after(sum([Record Count]),1,6)))

        / rangeavg(after(sum([Record Count]),1,6)))

  >= Threshold OR sum([Record Count])=0,1,0) >} Country)

but QV doesnt like this expression.

Any ideas on how to return my countries that are true?

1 Solution

Accepted Solutions
thomaslg_wq
Creator III
Creator III

First : you cannot sum countries, but you may count them

Second : You want to create a set analysis expression condition :

So it should be this expression (with [Country] in dimension):

count(distinct

{<

Country={<"=if(fabs((sum([Record Count]) - rangeavg(after(sum([Record Count]),1,6)))/ rangeavg(after(sum([Record Count]),1,6)))  >= Threshold OR sum([Record Count])=0,1,0)>0">}

>} Country)

View solution in original post

1 Reply
thomaslg_wq
Creator III
Creator III

First : you cannot sum countries, but you may count them

Second : You want to create a set analysis expression condition :

So it should be this expression (with [Country] in dimension):

count(distinct

{<

Country={<"=if(fabs((sum([Record Count]) - rangeavg(after(sum([Record Count]),1,6)))/ rangeavg(after(sum([Record Count]),1,6)))  >= Threshold OR sum([Record Count])=0,1,0)>0">}

>} Country)

View solution in original post