Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

sofiavaz
Contributor

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
MVP
MVP

Re: Analysis for different types of selections

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
5 Replies
MVP
MVP

Re: Analysis for different types of selections

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
MVP
MVP

Re: Analysis for different types of selections

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
sofiavaz
Contributor

Re: Analysis for different types of selections

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!

MVP
MVP

Re: Analysis for different types of selections

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
sofiavaz
Contributor

Re: Analysis for different types of selections

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

Community Browser