Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Analysis for different types of selections

Hi everyone, I´m trying to make an analysis possible to different types of selections.

The requirement may be to analyse the incoming orders by OrdItemInsDtWeek (probably this will be my default analyse) or by a range of manual ly selected days (wich means the user will  have to select a range of OrdItemInsDt' values)

I've tried to it in many ways but I didn't get there. My last try was with this expression:

=If(GetFieldSelections(OrdItemInsDt)>0, sum({<OrdItemInsDt={$(=GetFieldSelections(OrdItemInsDt))},OrdItemMillAlloc={*}-{'USA'}, OrdItemProdCd={*}-{'SHT'},OrdMasterOrdType={'CUST','STOCK-WHSE'}, OrdItemOrdStat={'CONFIRM','COMPLETE','HOLD'}>}if(OrdItemDelDate<>OrdMasterOrdDate, OrdItemOrdKgs))/1000, sum({<OrdItemInsDtWeek={$(=vLastInsDtWeek)},OrdItemMillAlloc={*}-{'USA'}, OrdItemProdCd={*}-{'SHT'},OrdMasterOrdType={'CUST','STOCK-WHSE'}, OrdItemOrdStat={'CONFIRM','COMPLETE','HOLD'}>}if(OrdItemDelDate<>OrdMasterOrdDate, OrdItemOrdKgs))/1000)

Do you have any idea what I might be doing wrong? Any help is welcome!

Thank you,

Sofia Vaz

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

The expression looks OK to me. First check the variable and the GetFieldSelections() function. Check the value of the variable and expression and and plug these values into the expression.

Should they have quotes?

OrdItemInsDt={"$(=GetFieldSelections(OrdItemInsDt))"},

OrdItemInsDtWeek={"$(=vLastInsDtWeek)"},

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

The expression looks OK to me. First check the variable and the GetFieldSelections() function. Check the value of the variable and expression and and plug these values into the expression.

Should they have quotes?

OrdItemInsDt={"$(=GetFieldSelections(OrdItemInsDt))"},

OrdItemInsDtWeek={"$(=vLastInsDtWeek)"},

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

Failing that, I would remove all the set filters and start with the basic expression:

=If(GetFieldSelections(OrdItemInsDt) > 0,

  Sum(If(OrdItemDelDate <> OrdMasterOrdDate, OrdItemOrdKgs))/1000,

  Sum(If(OrdItemDelDate <> OrdMasterOrdDate, OrdItemOrdKgs))/1000

)

Check the result and validate against your data model. Then add the set expression filters one at a time (except for the OrdItemInsDt, OrdItemInsDtWeek. If the result goes to zero, then you have no results matching all those conditions.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thank You Jonathan!

The expression is working better with your help. Now, the only issue is that i can't select more than one OrdItemInsDt... but I think is due to the data model!

jonathandienst
Partner - Champion III
Partner - Champion III

I think if you remove the condition "OrdItemInsDt={$(=GetFieldSelections(OrdItemInsDt))}", from the first expression then it will probably work...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

You're right! It's working! Thank you very much!