Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

Sorry,

=sum(Quantity)

its_anandrjs

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

its_anandrjs

Or in expression simple this

=$(vAntal)

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

Anyone that have an idea?

Thank you!

prieper
Master II
Master II

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

sum(Quantity) / ($(vAntal))

Anonymous
Not applicable
Author

Thank you for your answer.

I try but dont work.

A mistery...

Anonymous
Not applicable
Author

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

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

Good to know!

Anil_Babu_Samineni

May be format issue, Good it worked

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful