24 Replies Latest reply: Jan 10, 2018 8:06 AM by Mohammed Mukram Ali

# Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

Hi Guys

Trying to write a formula

Could you correct this?

if(GetSelectedCount({<[Product Sub Group]>}={'Cheese'}>}[Sales]))

I only want the chart to populate if cheese is selected

Thankyou

• ###### Re: Calulcated condition

Hi Aaron,

use the below formula in the conditional tab and Sum(Sales) in a your expression tab

Substringcount(Concat ([Product Sub Group],'|'),'Cheese')

Many Thanks

Karthik

• ###### Re: Calulcated condition

Sorry this is for Qlik sense right?

• ###### Re: Calulcated condition

No this is for QlikView

• ###### Re: Calulcated condition

Set a chart calculation condition:

=GetSelectedCount([Product Sub Group])

• ###### Re: Calulcated condition

Thats sort of correct

But how to make it populate when i select  the value cheese?

• ###### Re: Calulcated condition

try:

if( GetFieldSelections([Product Sub Group])=,'Cheese',sum(Sales),0)

• ###### Re: Calulcated condition

That does not work

• ###### Re: Calulcated condition

you have a "," before cheese..

what if u elminate it?

• ###### Re: Calulcated condition

Okay the expression is correct however it still does not work how it is intended to

Do i put the following expression in the calulated condition? or ad the dimension or expression??

Let me clarify i want to chart to show me sales and to populate only when i select the value cheese from a filter pane

• ###### Re: Calulcated condition

Okay Guys

Still not working

How would i write this

if(GetSelectedCount({<[Product Sub Group]>}={'Cheese'}>}

another

if(GetSelectedCount({<[Tshirt]>}={'Black'}>}

I only want the chart to populate if the defined value is selected?

As a calculated condition

Thankyou

• ###### Re: Calulcated condition

Did you check with chart properties ?

• ###### Re: Calulcated condition

you have to set a calculation condition as below under Add-ons->Data handling.

if( [Product Sub Group] = 'Cheese', -1, 0 )

with this condition your chart object will be filled only if you select the value 'Cheese' in the [Product Sub Group] field.

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

not working

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

please send a screenshot in order to see what are your current selections.

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

=If(GetSelectedCount([Product Sub Group]) > 0, Sum({<[Product Sub Group] *= {'Cheese'}>}[Sales Amount]))

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

Hi Sunny

This is what im getting

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

Can you post the image of the expression... as all I see is the chart... not sure if you use the expression correctly or not

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

=If(GetSelectedCount([Product Sub Group]) > 0, Sum({<[Product Sub Group] *= {'Cheese'}>}[Sales Amount]))

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

So, right now since nothing is selected, the expression doesn't show anything... isn't that what you want? Or would you want to see Cheese even if nothing is selected? For this you can try this

Sum({<[Product Sub Group] *= {'Cheese'}>}[Sales Amount])

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

I want the chart to show me the count of sales only when cheese the value is selected, but when it is not it shows all values

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

So if Cheese and Beer is selected... it should not show anything?

If([Product Sub Group] = 'Cheese', Sum([Sales Amount]))

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

let me see your object calculation condition.

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

In the calculated condition

if( [Product Sub Group] = 'Cheese', -1, 0 )

• ###### Re: Calulcated condition QlikSense!!!!!!!!!!!!!!!!!!!!!

Hi,

Maybe like this:

If([Product Sub Group] = 'Cheese', Sum([Sales Amount]),Sum({1}[Sales Amount]))