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

exclude dimension in expression

Hi!

I has a table as below with these calculations:

Start check: if ((year(winc_start_date) &'-'& month(winc_start_date)=Month),1,0)

Clear check:  if ((year(winc_cleared_date) &'-'& month(winc_cleared_date)=Month),1,0)

The dimension 'Ticket' is needed to make this work.

 

How can I exclude the 'Ticket' dimension in the table and only present the result per month month in one row?

excl dim.PNG

9 Replies
tresesco
MVP
MVP

It's grain mismatch issue. May be you just need one aggregation function like:

Sum(If(....))              - in both expressions

stekol61
Creator
Creator
Author

 

Hi!

Added  Sum(If(....)) , but it doesn't give the correct value

 

excl dim_2.PNG

tresesco
MVP
MVP

Could you share your sample app? Meanwhile try :

Sum(Aggr( Sum(If(....)) , Ticket))

MaxCld
Contributor II
Contributor II

Hi,

Or Sum(Aggr( Sum(DISTINCTIf(....)) , Ticket))

 

 

stekol61
Creator
Creator
Author

Hi!

This expression works if I select one month.

If i select more months it doesn't work

excl dim_3.PNG

sunny_talwar

How about this

Sum(Aggr(
  If(Year(winc_start_date) & '-' & Month(winc_start_date) = Month, 1, 0),
Ticket, Month))

 

stekol61
Creator
Creator
Author

Hi!

This works OK.

But I have problem with another expression.

It should calculate 'Average(winc_response_time_bh)'  (in minutes) per month with the same dimensions as previous.

'winc_response_time_bh' is e.g '05:12:20' (hh:mm:ss) for one ticket-

I have tried with this:

=if ((start_check=1) ,(Avg(Aggr(If (winc_response_time_bh>0, (Num#(Subfield(winc_response_time_bh,':',1))
+ Num#(Subfield(winc_response_time_bh,':',2)) /60),winc_response_time/60)
,winc_ticket,Month))))

But it gives the same vale for each month

sunny_talwar

I think it would be easier to help if you are able to share some sample data.

stekol61
Creator
Creator
Author

Hi!

Enclosed is the app with sample data.

Filters are preset and you only need to select 'Period', 2019-08, 2019-09 and 2019-10 

In the sheet 'My new sheet' I have tested my calculations.