Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
greend21
Creator III
Creator III

Return two results from IF

I have an IF statement as a variable in set analysis. I want it to show both Assigned and Completed items if nothing else in this field is selected but I am unable to figure this out.

This is what I tried:

vHideUnassigned = If(GetSelectedCount(AssignedCompleted) = 0, 'Assigned' and 'Completed', GetFieldSelections(AssignedCompleted))

Measure in Chart:

Count({<AssignedCompleted={'$(=$(vHideUnassigned))'}>}AssignedCompleted)

1 Solution

Accepted Solutions
sunny_talwar

Or this

If(GetSelectedCount(AssignedCompleted) = 0, Count({<AssignedCompleted = {'Assigned', 'Completed'}>}AssignedCompleted), Count(AssignedCompleted))

View solution in original post

8 Replies
patilamay
Contributor III
Contributor III

Hi Dan,

Can you tell me what does AssignedCompleted field contain?


And I think you got your if statement wrong for vHideUnassigned variable.


It can be like this

vHideUnassigned = If(GetSelectedCount(AssignedCompleted) = 0, 'Assigned'&chr(44)& 'Completed', GetFieldSelections(AssignedCompleted))


This should give you two results for the variable.


HTH

Thanks,

sasiparupudi1
Master III
Master III

vHideUnassigned = If(GetSelectedCount(AssignedCompleted) = 0, Chr(39)& 'Assigned' & Chr(39)&chr(44)& Chr(39)&'Completed'& Chr(39),GetFieldSelections(AssignedCompleted))



Count({<AssignedCompleted={"$(=vHideUnassigned)"}>}AssignedCompleted)

sasiparupudi1
Master III
Master III

great, please close this thread by marking a correct and any helpful answers

greend21
Creator III
Creator III
Author

This did not work. I'm thinking it still must have something to do with all the quotes .

greend21
Creator III
Creator III
Author

This field contains the values Assigned, Unassigned, and Completed. I want these two values returned so that my chart will default to having these two items displayed, but will also allow changes in selection from the listbox . It may have something to do with the way the variable is in the set analysis but this isn't displaying anything on my chart. I'm trying to figure out how to get the quotations rights as I think that might be the issue.

sunny_talwar

May be this

Count({<AssignedCompleted *= {'Assigned', 'Completed'}>}AssignedCompleted)

sunny_talwar

Or this

If(GetSelectedCount(AssignedCompleted) = 0, Count({<AssignedCompleted = {'Assigned', 'Completed'}>}AssignedCompleted), Count(AssignedCompleted))

greend21
Creator III
Creator III
Author

This was a different way at looking at the expression that I had not considered but it is a good idea and also much less complex to look at. Thank you!