Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
thomasreynaert
Contributor III
Contributor III

if statement in set expression

Hi everyone

Could someone explain so I understand QV logic better why this is:

Not a working formula

Count({$<[so_order_date_YYYYMM]={">=$(=min(date($(vPeriod3),'YYYYMM')))<=$(=max(date($(vPeriod4),'YYYYMM')))"},so_order_date_month={$(vExp_Selected_Date_Month)},$(vExp_Unselect_datefields),

If($(vShowUSLogic)=0,$(vStock),$(vStockUS)),$(vExternalClients),$(vExcludingArticleTypes)>}  so_ordernumber)

and this:

Working formula

=If($(vShowUSLogic)=0,Count({$<[so_order_date_YYYYMM]={">=$(=min(date($(vPeriod3),'YYYYMM')))<=$(=max(date($(vPeriod4),'YYYYMM')))"},so_order_date_month{$(vExp_Selected_Date_Month)},$(vExp_Unselect_datefields),

$(vStock),$(vExternalClients),$(vExcludingArticleTypes)>}  so_ordernumber) ,

Count({$<[so_order_date_YYYYMM]={">=$(=min(date($(vPeriod3),'YYYYMM')))<=$(=max(date($(vPeriod4),'YYYYMM')))"},so_order_date_month={$(vExp_Selected_Date_Month)},$(vExp_Unselect_datefields),

$(vStockUS),$(vExternalClients),$(vExcludingArticleTypes)>}  so_ordernumber))


vStock & vStockUS are just variables containing a selection: delivertime_desc={'A','B','C'}

12 Replies
lorenzoconforti
Specialist II
Specialist II

Attached

I've modified your variables so now only the box on top right works but that's expected

Lorenzo

thomasreynaert
Contributor III
Contributor III
Author

Thank you! I was making adaptions in the variable with ' & " but nothing seemed to work there. So I wouldn't come up with the idea of changing the 'source' variables.

But it works, very happy with that!

lorenzoconforti
Specialist II
Specialist II

No problem. You just need to think of how those variables are evaluated in the chain. I usually work on them step by step with text boxes