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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

help with set analysis

Good morning,

I am struggling with this problem that involves set analysis. My objective is to calculate the count of inspections but considering different weights for each Category (2 and 3 have double weight) if MotivoID is 1, because if it is 2 should be single weight as it is for categories 1, 6 and 7.

My code is:

= (if(Ano > 2011 and MotivoID <> 2,

          ( 2 * Count({$< CategoriaID = {"2"} >}  InspeccaoID ) +

//          Count({$< CategoriaID = {"2"} >}  InspeccaoID ) +

//          Count({$< CategoriaID = {"3"} >}  InspeccaoID ) +

          2 * Count({$< CategoriaID = {"3"} >}  InspeccaoID ) +

 

          Count({$< CategoriaID = {"1"} >}  InspeccaoID ) +

          Count({$< CategoriaID = {"6"} >}  InspeccaoID ) +

          Count({$< CategoriaID = {"7"} >}  InspeccaoID )

          ))

          +

          if(Ano > 2011,

          count({$ <[MotivoID] = {"2"}>} InspeccaoID)))

So far it hasn't gave me the results I am looking for.

Any help will be very helpful.

Thanks in advance,

afonso

Labels (1)
4 Replies
shahamel
Creator
Creator

shahamel
Creator
Creator

Would you be so kind to send me a small file with an inline table which gives me a small example containing the fields:

Ano, MotivoID, CategoriaID and InspecaoID

In the meantime you can also use this document:

http://www.google.nl/url?sa=t&rct=j&q=p%20possible%20e%20exclude%20qlikview&source=web&cd=1&ved=0CCo...

Not applicable
Author

I think I managed to find a solution that solve my problem.

Thanks to all that try to help me.

Not applicable
Author

Thanks Sandeep. With all this notes I managed to solve my problem.

Best regards,

Afonso Lopes

De: Sandeep Hamelink

Enviada: segunda-feira, 12 de Agosto de 2013 12:29

Para: Afonso Lopes

Assunto: - Re: help with set analysis

<http://community.qlik.com/index.jspa> QlikCommunity

Re: help with set analysis

created by Sandeep Hamelink <http://community.qlik.com/people/shahamel> in New to QlikView - View the full discussion <http://community.qlik.com/message/377835#377835>