Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

expr correct me ?

Hi

=if(GetSelectedCount(product)>1,'select only one value',if($(vSum)=0,'no data for this ' or if($(vavg)=0,'no data for this 'or if($(vexp)=0,'no data for this '))))

here if product count is greater than one  then need to show  'select only one value'

if product count is equal or <1   then it has check any above variables having  value '0'

if it have then display   'no data to display'

here   vsum is sum(sales) ,  vavg=avg(sales)   vexpo is expensive of sales.

pls give this if condition

3 Replies
morganaaron
Specialist
Specialist

=if(GetSelectedCount(product)>1,

  'select only one value',

              if($(vSum)=0 or $(vavg)=0 or $(vexp)=0,

              'no data for this ',

               )

   )

Thought worth mentioning, if one of your variables isn't zero, you currently aren't showing anything..!

Anonymous
Not applicable
Author

Thanks for ur reply

if selected count 1 means i have to see the chart

in that selection field if no data means then i have too see 'nodata for this '

my variables wont be 0 always  but it has to check evry selection and if its not zero then i have too see data on chart

if its 0  then i have see mess no data to display

morganaaron
Specialist
Specialist

If you want to hide the chart where more than one product is selected, stick it in the layout tab as a conditional show and put the GetSelectedCount <> 1 part in there - you'll also then want a textbox that appears if the inverse is true (so if GetSelected > 1) that tells the user to select only one.

You'll then want the other part in your expression, assuming it's a straight table that will allow text to be shown, you'd want your expression to be something like:

if($(vSum)=0 or $(vavg)=0 or $(vexp)=0, 'no data for this ', sum(...))

So that it'll show 'No Data' if any of those = 0, but if it has values for them, show whatever you're wanting to show.

Otherwise, put it all in a conditional show on the layout tab, and have either one or multiple textboxes appear if any conditions are true.