Qlik Community

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
ggallina
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
ggallina
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!

View solution in original post

11 Replies
Highlighted
ggallina
Contributor III

Re: Variable with expression.

Sorry,

=sum(Quantity)

Highlighted

Re: Variable with expression.

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

Highlighted

Re: Variable with expression.

Or in expression simple this

=$(vAntal)

Highlighted
ggallina
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
ggallina
Contributor III

Re: Variable with expression.

Anyone that have an idea?

Thank you!

Highlighted
prieper
Honored Contributor II

Re: Variable with expression.

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

sum(Quantity) / ($(vAntal))

Highlighted
ggallina
Contributor III

Re: Variable with expression.

Thank you for your answer.

I try but dont work.

A mistery...

Highlighted
ggallina
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!

View solution in original post

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)