Dates in Set Analysis

Set vLastMonth= "=Date(Max(Month),'MMM-YY')";
Set v2ndLastMonth= "=Date(AddMonths(Max(Month),-1),'MMM-YY')";
 Data:
 LOAD*, Date(MonthStart(Date),'MMM-YY') as Month,Year(Date) as Year;
 LOAD CategoryName,
 Date,
 Sales,
 Amount
 FROM
 Data.xlsx
 (ooxml, embedded labels, table is [Data (2)]);

Capture.PNG

 

Expressions:

Sum( {$<Month={“$(=Date(Max(Month),’MMM-YY’))”}>} Amount )

Sum( {$<Month={“$(=Date(AddMonths(Max(Month),-1),’MMM-YY’))”}>} Amount )

Capture.PNG

Capture.PNG

Dates in Set Analysis

How to write the below set analysis in different way?

Sum({$<CurDay -={“$(=Date(Date#(‘5/30/2016′,’MM/DD/YYYY’),’MM/DD/YYYY’))”}>}[Causal Total Time])

If(CurDay=MakeDate(2016,5,30),0,1) as IsIncluded,

set analysis expression:

Sum({$<IsIncluded ={1}>} [Causal Total Time] )

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.