Announcements
cancel
Showing results for
Did you mean:
Contributor II

## Set analysis Question

I made a master measure to track ship qty for WTD which works great but I am not receiving any results when I perform a similar action for YTD. My goal is to display the total shipped qty for the current year when the items actual shipped date equals the same week reference of the scheduled ship week.

Sum( { \$< [SO Line Actual Shipment Date.autoCalendar.InYTD]={1}, [SO Line Actual Shipment Date.autoCalendar.YearsAgo]={0},[SO Line Actual Shipment Date.autoCalendar.WeekRelNo]=[SO Line Schedule Ship Date.autoCalendar.WeekRelNo] > } [SO Line Shipped Quantity] )

Labels (1)
• ### Set Analysis

1 Solution

Accepted Solutions

You are trying to compare two fields over here, its most of the time very slow but the syntax is like as below, use youur table key field in place of Yourkeyfieldhere in the below expression -

Sum( { \$<

[SO Line Actual Shipment Date.autoCalendar.InYTD]={1},

[SO Line Actual Shipment Date.autoCalendar.YearsAgo]={0},

Yourkeyfieldhere={"=SO Line Actual Shipment Date.autoCalendar.WeekRelNo]=[SO Line Schedule Ship Date.autoCalendar.WeekRelNo] "}

> } [SO Line Shipped Quantity] )

If possible you can try creating a flag field to check if both the dates are equal than set your indicator value to 1 in the script statemen. That way you can directly check in the above expression like dateEqualFlag = {1} in your set expression, I think that would give you far better performance.

2 Replies

You are trying to compare two fields over here, its most of the time very slow but the syntax is like as below, use youur table key field in place of Yourkeyfieldhere in the below expression -

Sum( { \$<

[SO Line Actual Shipment Date.autoCalendar.InYTD]={1},

[SO Line Actual Shipment Date.autoCalendar.YearsAgo]={0},

Yourkeyfieldhere={"=SO Line Actual Shipment Date.autoCalendar.WeekRelNo]=[SO Line Schedule Ship Date.autoCalendar.WeekRelNo] "}

> } [SO Line Shipped Quantity] )

If possible you can try creating a flag field to check if both the dates are equal than set your indicator value to 1 in the script statemen. That way you can directly check in the above expression like dateEqualFlag = {1} in your set expression, I think that would give you far better performance.

Contributor II
Author

Thanks for the reply. I found that I was able to resolve by utilizing a sum if function when comparing 2 fields versus trying to use the set analysis function.