Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

ExpressionGrouping in a chart?possible?

Hi Guys,

I have a chart with Dimension grouping(Material, Customer, Plant etc) and there are expressions likes sum(OrderquantityinPieces), Sum(DeliveryQuantityinPieces), Sum(DeliveryQuantityinPieces/OrderquantityinPieces), Sum(OrderquantityinCarton),Sum(DeliveryQuantityinCarton),Sum(DeliveryQuantityinCarton/OrderquantityinCarton), Sum(OrderquantityinPallet),Sum(DeliveryQuantityinPallet),Sum(DeliveryQuantityinPallet/OrderquantityinPallet)

This looks BigTable and I want to make it Dynamic where I can select the Data based on pallet, Carton, Pieces.

I also dont want to make individual charts with Cartons, Pallets, Pieces.

Just Like I made  Dimension as a cycleGroup to select the data, I want the expressions also to be dynamic and thereby reduce this bigtable to small 3 expressions like  Sum(Orderquantity), Sum(DeliveryQuantity), Sum(DeliveryQuantity/Orderquantity)

Any Ideas how to make this one simple?

Thanks

Sravan

1 Solution

Accepted Solutions
pat_agen
Valued Contributor

ExpressionGrouping in a chart?possible?

hi,

create a variable called vUoM  for example (for Units of measure). Put it in an input box with a constraint so that it can take the value 'Carton', 'Pieces' or 'Pallet'. Always have one selected value.

have three expressions in your chart like this:

sum(Orderquantityin$(vUoM))

sum(Deliveryquantityin$(vUoM))

sum(Orderquantityin$(vUoM))/Deliveryquantityin$(vUoM))

try it and see.

9 Replies
pat_agen
Valued Contributor

ExpressionGrouping in a chart?possible?

hi,

create a variable called vUoM  for example (for Units of measure). Put it in an input box with a constraint so that it can take the value 'Carton', 'Pieces' or 'Pallet'. Always have one selected value.

have three expressions in your chart like this:

sum(Orderquantityin$(vUoM))

sum(Deliveryquantityin$(vUoM))

sum(Orderquantityin$(vUoM))/Deliveryquantityin$(vUoM))

try it and see.

Not applicable

Re: ExpressionGrouping in a chart?possible?

Hi Pat,

correct me if I am wrong. For this solution to work after giving the value in the Inputbox, script must be reloaded to get the data. The users logging in through the accesspoint cannot do it. Hence it is not useful.

Thanks for your answer.

Regards

Sravan

pat_agen
Valued Contributor

Re: ExpressionGrouping in a chart?possible?

Hi Sravan,

It should work fine. No reload needed. It's simply $() expansion at work. The $(vUoM) will be replaced with one of the literals Pallets, pieces or cartons. The expression will read as sum(OrderquantityinPallets) for example. No reload needed.

try it

regards.

Not applicable

Re: ExpressionGrouping in a chart?possible?

Hi Pat,

After implementing this, the application does work fine but after sometime whenever I am saving, it does not react and I have to close the application thru the Taskmanager and open again. It is performance wise not good.

Regards

sravan

pat_agen
Valued Contributor

ExpressionGrouping in a chart?possible?

Hi Sravan,

I am surprised because it should just work as normal expressions. Could you post your qvw perhaps with some sample/scrambled data?

jagannalla
Valued Contributor III

Re: ExpressionGrouping in a chart?possible?

Hi Pat,

I just went through your procudure really it is good. But when i'm trying to do dis it displying the error in expression as you can see in enclosed image.

Untitled.png

Not applicable

Re: ExpressionGrouping in a chart?possible?

Hi Jagan,

Does your fieldname is OrderQuantity$(vData) ?

I mean if you defined the Variable vData as KAR then the field must be same as OrderQuantityKAR. Then only it will work.

Hope that helps

Sravan

jagannalla
Valued Contributor III

Re: ExpressionGrouping in a chart?possible?

Sravan ya it is same as KAR...

If it is working in your application because when i tried in expression like sum(OrderQuantityKAR). It is working if i tried my using input variable it's not working i.e sum(OrderQuantity$(vData))

jagannalla
Valued Contributor III

Re: ExpressionGrouping in a chart?possible?

Ya it's working... in mistake i added single quote ( ' ).

Community Browser