Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
JLozier007
Contributor II
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)
1 Solution

Accepted Solutions
Digvijay_Singh

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.

 

 

View solution in original post

2 Replies
Digvijay_Singh

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.

 

 

JLozier007
Contributor II
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.