Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
brunolelli87
Creator II
Creator II

Conditional expression on a chart

Dears,

I have a chart with

Dimensions = Stickers and,
Expression =num(avg([P/L]), '#.##0,00;-#.##0,00')

So, the user can select some Stickers, as dimensions, and I would like that, if just one Sticker is selected, the system should show 2 bars, the one related to the expression, and another one with the following formula: "=num(avg({<Sticker,SubsetorEmpresa=p(SubsetorEmpresa)>}[P/L]),'#.##0,00;-#.##0,00')"

I'm trying to use the conditional function with the following formula: 
"= IF(GetSelectedCount(Sticker) > 0, 1, 0)", but it's not working properly..

How can I do it?

 

Thanks

Bruno Lelli

1 Solution

Accepted Solutions
brunolelli87
Creator II
Creator II
Author

I found a way to solve it...

On condition field:
GetSelectedCount(Sticker) = 1

On expression field:
=num(avg(TOTAL {<Sticker,SetorEmpresa=p(SetorEmpresa)>}[P/L]),'#.##0,00;-#.##0,00')

 

Thanks guys!

View solution in original post

3 Replies
Lisa_P
Employee
Employee

On the second expression, use the condition:
= IF(GetSelectedCount(Sticker) > 0)

brunolelli87
Creator II
Creator II
Author

It's not working

What do you mean by the second expression?

Please, check the picture...

 

brunolelli87
Creator II
Creator II
Author

I found a way to solve it...

On condition field:
GetSelectedCount(Sticker) = 1

On expression field:
=num(avg(TOTAL {<Sticker,SetorEmpresa=p(SetorEmpresa)>}[P/L]),'#.##0,00;-#.##0,00')

 

Thanks guys!