12 Replies Latest reply: Mar 25, 2017 1:12 AM by Ahmad Abdolkhalegh

# Set analysis

Hi all

i have a table as follow, it has so many rows but here i bring 3 rows as example:

BranchChannelInvoice No.Invoice DateInvoice Due DateAccounts Receivable

A

Retail101/01/201760 days after invoice date10
AHospital201/01/201790 days after invoice date30
AReferral301/01/2017120 days after invoice date50

i want to create a measure or expression for overdue.

our company has a rule for what to be called overdue as follow:

if channel is Retail and it has passed more than 30 days from Invoice due date it would be overdue

if channel is Referral and it has passed more than 120 days from Invoice date it would be overdue

if channel is Hospital and it has passed more than 150 days from Invoice date it would be overdue

Now i want to have an expression for overdue, which if i choose retail it shows me just retail overdue.

if i use set analysis and filter channel, it always shows me all overdue for all channel

am i suppose to use set analysis,How?

• ###### Re: Set analysis

What is your desired output for the 3 rows you have provided above?

• ###### Re: Set analysis

If today is based, 10 for Retail and 10 for All channel is the output.

if 04/01/2017 is based, 10 for Retail, 30 for Hospital and 40 for All channel.

• ###### Re: Set analysis

How will Retail show 10? Today is 3/16 and Invoice Due date is 3/2/2017 (1/1/2017 + 60 days).... If for retail, the overdue date is Invoice Due date + 30 days, then it isn't due until 4/2/2017 I think

• ###### Re: Set analysis

Yes you are right, my mistake but you know what i mean

my problem is if i use channel in my dimension i cant use filter

• ###### Re: Set analysis

Why not?

• ###### Re: Set analysis

Actually i can but because of my formula when i filter channel on retail it shows me sum of all overdue, i think my problem is my formula. for every channel i write one set analysis and i think its wrong

• ###### Re: Set analysis

Would you be able to share a sample where we can see your problem?

• ###### Re: Set analysis

Sum({\$<Channel={Retail},Measure A={'>30'}>+\$<Channel={Hospital},Measure B={'>150'}>+\$<Channel={Referral},Measure C={'>120'}>}Accounts Receivable)

Measure A=Today- Invoice Due Date

Measure B=Today- Invoice Date

• ###### Re: Set analysis

Is this the solution? I am not sure if you are asking me something... but you can try this

Sum({\$<Channel={Retail}, [Invoice Due Date] ={"=Today() - [Invoice Due Date] > 30"}>+\$<Channel={Hospital}, [Invoice Due Date] ={"=Today() - [Invoice Due Date] > 150"}>+\$<Channel={Referral}, [Invoice Due Date] ={"=Today() - [Invoice Due Date] > 120"}>}Accounts Receivable)

• ###### Re: Set analysis

No it's not the solution, it's the formula i am using. it's pretty similar to what you write.

even when i use your formula it always shows me total Overdue!

here is my table when i use no filter on my channel:

here is my table when i filter my channel on Retail:

you can see now my Accounts Receivable field shows me only Retail and Overdue Total!!

I want to see only retail overdue

i hope you can help me on this

Thanks again

• ###### Re: Set analysis

Try this

Sum({\$<Channel *= {Retail}, [Invoice Due Date] ={"=Today() - [Invoice Due Date] > 30"}>+\$<Channel *= {Hospital}, [Invoice Due Date] ={"=Today() - [Invoice Due Date] > 150"}>+\$<Channel *= {Referral}, [Invoice Due Date] ={"=Today() - [Invoice Due Date] > 120"}>}Accounts Receivable)

• ###### Re: Set analysis

Thanks Sunny, it works like a charm