Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
asantos
Contributor III
Contributor III

If Statements on a dimension to handle lines of a pivot table

Hello there,

After trying multiple combinations of these if statements, I can't wrap my head around it to get it working properly. I'll try to lay out the problem as best as I can so that you guys can help me out - hopefully:

Data Table:

SelectionTypeDescription
N/ABonus
N/ABonus Unit
SimpleDescountSalesSD
SimpleDiscountMarginSD
DiscountReavSalesDR
DiscountReavMarginDR
TotalDiscountSalesTD
TotalDiscountMarginTD

 

I have this layed out on a pivot table and the need is to handle the dimension so that the table shows:

01 - N/A, because these 'lines' are to be there independent upon the type of discount chosen;

02 - The lines that relate to the SelectionType.

I have been trying the following, but without success as it doesn't hide the rows not related to the SelectionType. It keeps showing everything:

 

=if(Description = 'Expenses',
	if( not '$(vExpandDesp)' = 'Expenses', null(), Description),//This is for a couple of lines that expand or collapse depending on another variable
    	if(SelectionType = 'N/A', Description,//This is to keep 'N/A' unhidden
        	if(SelectionType = vSelectionVar, Description, null())))//This is to show only rows that meet the variable criteria

 

 Appreciate your time.

Labels (3)
1 Solution

Accepted Solutions
asantos
Contributor III
Contributor III
Author

After double checking backwards, I found out that the there was a flaw when creating the SelectionType column in a way that there'd be duplicates for some of the Description rows. 

It may sound such a basic mistake, but this also takes a lot of time (for beginners like me), where we are looking at the problem from a perspective, while the origin of the issue is somewhere else.

 

Cheers,

View solution in original post

5 Replies
sunny_talwar

It might be easy if you are able to share a sample where we can see the issue.

asantos
Contributor III
Contributor III
Author

Hello @sunny_talwar !

I've actually found out why this wasn't working.

There was a flaw when creating the SelectionType column in a way that there'd be duplicates for some of the Description rows. Fixed it.

Not sure if I should mark it as solved, through, or just delete it.

 

Cheers,

Antonio

sunny_talwar

Mark your own response as the correct answer

asantos
Contributor III
Contributor III
Author

I'll do that, but it may seem misleading...as if I'm creating an issue to be the savior! Cheers!

asantos
Contributor III
Contributor III
Author

After double checking backwards, I found out that the there was a flaw when creating the SelectionType column in a way that there'd be duplicates for some of the Description rows. 

It may sound such a basic mistake, but this also takes a lot of time (for beginners like me), where we are looking at the problem from a perspective, while the origin of the issue is somewhere else.

 

Cheers,