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

Is possible to use alternate States with set analysis

Hello,

I try to create the new chart with use set analysis with alternate States !!!

I have this Expression

Sum( {1<TRANS_TYPE={"VOUCHER"} ,POST_DATE=  {"<=$(=Max(POST_DATE))"} >} (ITEM_QTY*VOU_n)*Cost_Item)

How I can add alternate States like Group1

Many Thanks

Abdulaziz

1 Solution

Accepted Solutions
sunny_talwar

In your expression you seem to be ignoring all the selections using 1.... if that is true the only place where alternate state can play a role is in the selection on POST_DATE.... you can try this

Sum({1<TRANS_TYPE = {"VOUCHER"}, POST_DATE =  {"<=$(=Max({[Group1]} POST_DATE))"}>} (ITEM_QTY*VOU_n)*Cost_Item)

If one was to avoid selections in inherited state and you want the selections to be driven from  Group1 state... then try this

Sum({[Group1]<TRANS_TYPE = {"VOUCHER"}, POST_DATE =  {"<=$(=Max({[Group1]} POST_DATE))"}>} (ITEM_QTY*VOU_n)*Cost_Item)

or this if POST_DATE selection is still driven by inherited state

Sum({[Group1]<TRANS_TYPE = {"VOUCHER"}, POST_DATE =  {"<=$(=Max(POST_DATE))"}>} (ITEM_QTY*VOU_n)*Cost_Item)



View solution in original post

10 Replies
mayankraoka
Specialist
Specialist

Like this:

Sum( {1+ Group1<TRANS_TYPE={"VOUCHER"} ,POST_DATE=  {"<=$(=Max(POST_DATE))"} >} (ITEM_QTY*VOU_n)*Cost_Item)

Regards,

Mayank

oknotsen
Master III
Master III

Yes, you can use Set Analysis together with Alternate States.

Example:

=sum({$ < CompanyName=Group2::CompanyName > } LineSalesAmount)

In the above example we use the selection in CompanyName in the Alternate State "Group2" and pretend it is selected for the default state.

Example 2:

= sum({Group2 < Year = $::Year > } LineSalesAmount)

In the above example we use the selection on Year in the default state as the selection for those in Group2.

May you live in interesting times!
abdulaziz
Contributor III
Contributor III
Author

Hello Mayank

I try this before, It gives me an error number

mayankraoka
Specialist
Specialist

Is it possible to share sample qvw and error screenshot here.

Regards,

Mayank

sunny_talwar

In your expression you seem to be ignoring all the selections using 1.... if that is true the only place where alternate state can play a role is in the selection on POST_DATE.... you can try this

Sum({1<TRANS_TYPE = {"VOUCHER"}, POST_DATE =  {"<=$(=Max({[Group1]} POST_DATE))"}>} (ITEM_QTY*VOU_n)*Cost_Item)

If one was to avoid selections in inherited state and you want the selections to be driven from  Group1 state... then try this

Sum({[Group1]<TRANS_TYPE = {"VOUCHER"}, POST_DATE =  {"<=$(=Max({[Group1]} POST_DATE))"}>} (ITEM_QTY*VOU_n)*Cost_Item)

or this if POST_DATE selection is still driven by inherited state

Sum({[Group1]<TRANS_TYPE = {"VOUCHER"}, POST_DATE =  {"<=$(=Max(POST_DATE))"}>} (ITEM_QTY*VOU_n)*Cost_Item)



sujeetsingh
Master III
Master III

seems he forgot to mark it answered or leave a comment.

abdulaziz
Contributor III
Contributor III
Author

I try with this but I get (errors in Expression)

This my Code :

Sum( {1<TRANS_TYPE=StatesA::{"VOUCHER"},

SLIP_FLAG=StatesA::{'0'}  ,

OH_STATUS=StatesA::{"*"} - {"Not In inventory"},

POST_DATE=StatesA::  {"<=$(=Max(POST_DATE))"} >}

(ITEM_QTY*VOU_n)*Cost_Item)

!Capture.JPG

abdulaziz
Contributor III
Contributor III
Author

OMG you are genius

I use the first code

This what I need ^_^

Many Thanks

abdulaziz
Contributor III
Contributor III
Author