15 Replies Latest reply: Oct 2, 2012 4:59 PM by satyajeet29

# How to add multiple variables to an expression?

Hi,

I am trying to create a chart that shows the count of "Yes" and "No" from our data.  I have two column legal validated (Yes/No) and Comp Validated (Yes/No).  How can I get the count of No/No, Yes/No, No/Yes, all under the same count as 'No'? And then show a count of all the 'Yes/Yes"?

I was able to get a count of the Yes and No using this equation;

Dual(CompValidation&' - '&Count(DISTINCT([Topic),Count(DISTINCT(Topic)))

Thank you,

Nicholas

• ###### Re: How to add multiple variables to an expression?

Hi,

Try this set analisys expresion

Count({\$<Legal= {"Yes"},Comp= {"Yes"}>}Dimension)

Count({\$<Legal= {"Yes"},Comp= {"No"}>}Dimension)

Count({\$<Legal= {"No"},Comp= {"Yes"}>}Dimension)

Count({\$<Legal= {"No"},Comp= {"No"}>}Dimension)

• ###### Re: How to add multiple variables to an expression?

I do not think i have the right dimention.  What would I use?   I am ok with having 2 pie charts, one that shows everything for Legal the other that shows everything with CompValidated.  Thank you.

• ###### Re: How to add multiple variables to an expression?

on the above set analysis expressions provided by Gregorio instead of "Dimension" you need to write "TOTAL(Dimension)"

It will solve the problem

attached application for your reference to count the number of No and Yes

• ###### Re: How to add multiple variables to an expression?

I got the graph going. Thank you.

In the Dimensions field I am putting in the topic associated with all these values.  Is there a way to add a DISTINCT to it.  When I added DISTINCT it did not seem to work.  The Topic Area is a field classified by a drop down associated to each CompValidated and LegalValidated.

Ex:

Topic                                                                                                                        Legal          Company

 Agricultural Comm YES NO Agricultural Swap YES YES #Confirmation, Portfolio Reconciliation, YES NO #Confirmation, Portfolio Reconciliation, YES NO #Confirmation, Portfolio Reconciliation, YES NO

=count({<CompValidation={'NO'},LegalValidation={'NO'}>} total(DISTINCT([TopicArea])))

Thank you for the first part.

• ###### Re: How to add multiple variables to an expression?

In this case write the expression like this

=count({<CompValidation={'NO'},LegalValidation={'NO'}>} [TopicArea])

This way you will be able to count as per the field "TopicArea"

• ###### Re: How to add multiple variables to an expression?

I have attached a pivot table for understanding the expressions

• ###### Re: How to add multiple variables to an expression?

That worked thank you.  Is there a special technique to add labels next to the numbers that are shown on the pie charts? For instance I have 4 pieces and would like to see their corresponding numbers with labels on them?

Thank you for yoru help.

• ###### Re: How to add multiple variables to an expression?

I was just now checking with the Pie Chart options.

I am not sure but

I guess you need to select the "Pop up Labels" option in the Presentation tab for the Properties of the Chart.

Now when you move your cursor/pointer over the given section of Pie-Chart it will then display
the "Expression Value" and the "Topic" associated with that expression.

Attached QVW file for Reference

• ###### Re: How to add multiple variables to an expression?

Thank you.  That will work.

They asked if I would be able to combine the 3 expressions like you did to equal 'no.' Can I just add it to the end or does it need to be recalculated?  Basically looking for two answers in the chart. Yes and No.

Thanks

• ###### Re: How to add multiple variables to an expression?

No need of Recalculations all expressions are independent of each other.

I have done that in a pivot table and attached for your reference

• ###### Re: How to add multiple variables to an expression?

HI,

Sorry for taking so long to respond.  I understand what you did. I am running into an error issue "all values below Limit." Any thoughts?  My maximum number of slices is set to 15.

Thank you,

• ###### Re: How to add multiple variables to an expression?

Hi Haagenfels,

Can you elaborate this problem a bit more. Is it related to the questions answered by me before.

Or is it different.

If different please elaborate it further.

• ###### Re: How to add multiple variables to an expression?

Haagenfels,

What I can speculate right now reading your requirement it seems you are  facing problems with pie-charts.

I have attached a image on properties of  Pie Charts

consisting of Dimension Limits Tab.

What I can suggest over here is that you need ti bit play around with the "limits" options

of the "Dimensions Limits" .

If you can send me a screen shot of the Dimension Limits of your chart i might be able to suggest you better.

Satyajeet

• ###### Re: How to add multiple variables to an expression?

Hi,

Yes it is related to the question above.  The pie chart i am trying to create come up with the error message mentioned above.

I am using qlikview 10.  Do I have the same dimensions tab? Here is a screen shot of the limits i found with the pie chart.

• ###### Re: How to add multiple variables to an expression?

Hi Haagenfels,

You need to reduce the lower limit to a very small fractional value

on  " Lower Limit on Slice Area " option

and deselect the "Relative" option in Expressions tab too.