Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
madnanansari
Creator
Creator

Dividing variables bring wrong values

I have defined the below variables in the system:

vSales1

vSales2

vTickets1

vTickets2

vSales = $(vSales1) + $(vSales2)

vTickets = $(vTickets1) + $(vTickets2)

AverageSales = ($(vSales1) + $(vSales2)) / ($(vTickets1)+$(vTickets2))

bring rights results.

where as the below formula brings wrong results:

AverageSales = $(vSales) / $(vTickets)

any idea how to resolve this?

15 Replies
madnanansari
Creator
Creator
Author

it brings all the column having the same values. Infact I am using Qlik Sense but posted here in Qlik View. Sorry for that.

madnanansari
Creator
Creator
Author

dont work. Infact I am using Qlik Sense instead of Qlik View. Sorry for that.

madnanansari
Creator
Creator
Author

no this is not the case.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Please change the forum by following the instructions given here: QlikCommunity Tip: How to move your discussion thread

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Note that in QlikView objects, $-sign substitution is performed before the object is recalculated. And cannot change row-by-row.

Are the vSales1 & 2 and vTickets1 & 2 variables dependent on something that should change in every row? What do they contain?

julioarriaga
Creator II
Creator II

Thanks Rob, but isn't misleading this operation order? I don't see any case in which we would want to divide first the last element of a dollar expression before finishing the evaluation.