Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

problem with rank in the set analysis

hello to all

  I'm with the following problem

have to find the greatest competitors of my client

I am using this expression

only ({<Group= {"=rank(sum([Ingresso Total] ),Grupo) 1"}>} = Group)

  and

only ({<Group= {"=rank(sum([Ingresso Total] ),Grupo) 2"}>} = Group)

  it returns me exactly what I seek, I put the two expressions in two variables.

Only then used the vTOPGrupo variables and vTOPGrupo2 respectively

sum ({<Modalidade {'Presencial'}, Group ={$(=$(vTOPGrupo2))} =>} [Total Joined])

  The problem is that some groups zeroed return and use the same expression

setting the group name that appears wrong, this way

sum ({<Modalidade {'Presencial'}, Group ={'XXX'} =>} [Total Joined])

it returns the correct value, and I'm seeing the same group

  can someone help me

1 Solution

Accepted Solutions
swuehl
MVP
MVP

6 Replies
swuehl
MVP
MVP

Your search expressions like

=rank(sum([Ingresso Total] ),Grupo) 1


don't seem right to me. Are you sure this is how they look and that's it not a typo in your post?

I would have expected something like


=rank(sum([Ingresso Total])) = 1


BTW, what is Grupo?


In anyway, your search expression doesn't return Group field  values, so you can't compare it to a modifier like {'XXX'}.


I think it would be best if you could upload a small sample application.


Regards,

Stefan


Not applicable
Author

was a mistake in typing the correct is

only ({<= {Group "= rank (sum ({<Modalidade {'Presencial'}>} = [Total Admission]), Group) = 1"}>} Group)

Grupo is group in portuguese.

in these variable

vTOPGroup =only ({<= {Group "= rank (sum ({<Modalidade {'Presencial'}>} = [Total Admission]), Group) = 1"}>} Group)

i'll return a group field value correct?

i use this variable in that expression

sum ({<Modalidade {'Presencial'}, Group ={$(=$(vTOPGroup))} =>} [Total Admission]))

That return to me the value with misses  or null ( only in a few cases

but if  the expression be like this

sum ({<Modalidade {'Presencial'}, Group ={'XXX'} =>} [Total Admission]))

being that vTOPGroup also returns me XXX

the result is right.

Sorry for the poor english is not the strong in my country

I cant make a sample because  the qvw is too big and the cases only show yourself with a huge base .

thanks Stefan

swuehl
MVP
MVP

I am still unsure if your expression is correct, but anyway, if vTopGroup returns the correct group e.g. when using

=vTopGroup

in a text box, I think you should write

=sum ({<Modalidade {'Presencial'}, Group ={'$(vTOPGroup)'} =>} [Total Admission]))


I am assuming you defined your variable with a leading equal sign in variable overview, right?

Not applicable
Author

I also thought it would work the same way but is not q happens.

I'm having trouble attaching the test in the forum, so I'm sending a link to the dropbox.

This same function that returns null in some other selections returns the correct value.

https://www.dropbox.com/s/x81nz76fr4k0ogt/test.qvw

swuehl
MVP
MVP

Check attached.

Not applicable
Author

the forms of declare a function in variables and how you put into a set analysis is pretty confusing.

Thanks for your help swuehl.