Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple if's to display

I am new to qlikview and I am trying to figure this out. I have three separate list boxes they are a selection box for populating a straight table. So I have 2 report measure boxes, one with cost data and one without. The other one is the dimensions box, at least one measure and dimension must be selected in order for a chart to be shown. My code worked find with just one measure and one dimension but I am having trouble with the if statement.

=if(GetSelectedCount(%Dimensions) > 0 AND GetSelectedCount(%Measure)>0,1 ,0)

Worked fine,

But if I try to add another one like this I cant figure out how to do this.

if(GetSelectedCount(%Dimensions)>0 AND GetSelectedCount(%CostMeasure),1,0)

any help would be great

5 Replies
sunny_talwar

mike donoghue wrote:

if(GetSelectedCount(%Dimensions)>0 AND GetSelectedCount(%CostMeasure),1,0)

Did you may be miss a  > 0 for the second GetSelectedCount()

Not applicable
Author

Oops that's a typo in the question sorry about that.

Not applicable
Author

=if(GetSelectedCount(%Dimensions) > 0 AND GetSelectedCount(%Measure)>0,1,0)
or if(GetSelectedCount(%Dimensions)>0 AND GetSelectedCount(%CostMeasure)>0,1,0)

This is how it is written now.

sunny_talwar

Try this:

=If(

     (GetSelectedCount(%Dimensions) > 0 and GetSelectedCount(%Measure) > 0) or

     (GetSelectedCount(%Dimensions) > 0 and GetSelectedCount(%CostMeasure) > 0), 1, 0

    )

Not applicable
Author

This solution comes out to be the same problem. If I select one from dimension and measure, all of the selections within costmeasure show up. I need the two to be completely separate. but will populate the same chart.

thank you sunny