I tried debugging and came to conclusion that there's a mistake in my if(vMeasure=1 and if(GetSelectedCount(Selection)>0. The initial selection of 'Selection' field is not there so num(getselectedcount(selection)>0 does not get fulfilled and the expression is dropped. I tried if(vMeasure=1 and if(num(GetSelectedCount(Selection))<0 and since initial selection is 0, num(getselectedcount(selection)<0 got fulfilled and generated the chart.
My question is is that since qlik doesnt have else if, would it be possible to get this to work?
I've reformatted the Net expression to be "correct" for expression syntax below ie not relying on if..then..else which can be used in load scripts.
Note : there's no generic else clause to capture where vMeasure is not 1 or the count of the selection is zero. If the intent is to have one expression that covers Inflow and Outflow as well then you can continue to expand the expression below by changing (SUM(CGL.Amount))) into (SUM(CGL.Amount)),if(condition,then,optional_else) ) ie inserting more nested if statements inside the final closing bracket.