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

Expression ( Dont show where the value is 0)

so i have a table which has 2 measure ,

1 Column Total Price 

 Sum({< FLAGA={'T'}>} [ABC Sold] )

2  Column FIFA 18 

Sum({< FLAGA={'T'}, [Product Name] = {'FIFA 18'} >} [ABC Sold] )

 

I want to format column 1 that if column 2 has value 0 then do not show the value in Column 1

 

@sunny_talwar 

Labels (1)
3 Replies
Marcos_rv
Creator II
Creator II

half complicated what you ask, jajajaj
what you could do is a left in the script until you get a flag for your product or products, for example flag_prod,
After you add it in the set analisys, you know that if you have a fifa18 product at least one sale you had, so:}


1 Column Total Price

Sum ({<FLAGA = {'T'}, flag_prod = {1}>} [ABC Sold])

2 FIFA 18 Column

Sum ({<FLAGA = {'T'}, [Product Name] = {'FIFA 18'}, flag_prod = {1}>} [ABC Sold])

there you would only have the 2 columns you need.

Note, this flag is used to group, I suppose you must have a field like invoice number or order and within this you have the items.

regards!!!

everest226
Creator III
Creator III
Author

i Manage to do in expression but somehow the total is not correct but if i export in excel it is correct not sure why.

column 1

if(Sum({< FLAGA={'T'}, [Product Name] = {'FIFA 18'}> [ABC Sold] )>0,
 Sum({< FLAGA={'T'}>} [ABC Sold] ))

 

column 2 

if(Sum({< FLAGA={'T'}, [Product Name] = {'FIFA 18'}> [ABC Sold] )>0,
Sum({< FLAGA={'T'}, [Product Name] = {'FIFA 18'}> [ABC Sold] ))

 

 

 

 

sunny_talwar

You can try this

Sum({<FLAGA = {'T'}, Area = {"=Sum({<FLAGA={'T'}, [Product Name] = {'FIFA 18'}>} [ABC Sold]) <> 0"}>} [ABC Sold])

But this will only work if Area is the only dimension in your chart. If you add other dimensions, then this won't work. The other option is just this

If(Sum({<FLAGA={'T'}, [Product Name] = {'FIFA 18'}>} [ABC Sold]) <> 0, Sum({<FLAGA = {'T'}>} [ABC Sold]))