# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Contributor III

## Variable with expression.

Hi,

I have a strange problem.

I create a variable to calculate the total of a selection:

Variable name: vAntal

=sum(ST0QO1)

When I use the variable in a table anf I do this:

sum(Quantity) / \$(vAntal)

It dont work! I dont know why, I did this many times without problem.

If I write this (without DSE, Dollar Symbol Extension) it work!

sum(Quantity) / vAntal

I use Qlikview 12 SR2 but it work fine with other table/data.

You can try with the sample that I attached.

Anyone have a idea?

Thank you!

Best regards.

1 Solution

Accepted Solutions
Highlighted
Contributor III

## Re: Variable with expression.

I dont know why but I try and it work with this:

=sum(Quantity) / num(\$(vAntal),'###')

Good to know!

11 Replies
Highlighted
Contributor III

Sorry,

=sum(Quantity)

Highlighted
MVP

## Re: Variable with expression.

In the variable definition remove equal sign before the variable defintion and check the variable output.

Highlighted
MVP

## Re: Variable with expression.

Or in expression simple this

=\$(vAntal)

Highlighted
Contributor III

## Re: Variable with expression.

I use the = sign to have the total calculated. I know that I can do also this:

sum(Quantity) / sum(TOTAL Quantity)

but it is possible to do with variable and = sign.

If you try the attached it work.

Highlighted
Contributor III

## Re: Variable with expression.

Anyone that have an idea?

Thank you!

Highlighted
Honored Contributor II

## Re: Variable with expression.

not quite sure, why - but you may try to enclose in brackets.

sum(Quantity) / (\$(vAntal))

Highlighted
Contributor III

## Re: Variable with expression.

I try but dont work.

A mistery...

Highlighted
Contributor III

## Re: Variable with expression.

I dont know why but I try and it work with this:

=sum(Quantity) / num(\$(vAntal),'###')

Good to know!

Highlighted

## Re: Variable with expression.

May be format issue, Good it worked

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)