Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to perform a calculation without using sum

Hi,

In my QVW one of the fields named sales has a value which is correct for each week if i take it in a text box, if i use a text object and do SUM(Sales) what happens is instead of calculating the sales for the given filters its calculating the sales for everything because the sales is already aggregated before coming into this QVW.

If i pick a certain date and in the text object if i do Sales i get the exact value but if i do sum(sales) it gives me everything.

The problem with this is, if i pick multiple dates the text box gets blanked out as i am not doing any aggregation operation.

I could have posted my QVW but its too large.

Can someone please throw any suggestions on this?

Thanks.

20 Replies
Not applicable
Author

Hi Henric,

Yes you are right i have multiple transactions per day and each location has 1 transaction so, if i pick multiple dates and say one location then the transaction count must be the sum of that location for all the dates selected.

I hope this is clear , if not please let me know i will try to explain more clearly.

Thanks

hic
Former Employee
Former Employee

So, if I select 1 location and many dates, should I always sum the number? Or is there a limit, per week, or so?

And if I select 1 date and many locations, should I never sum the number? What should I do instead? Average?

HIC

Not applicable
Author

Basically the way the QVW is designed is the date we see it has the sales and everything for the whole week aggregated to that date.

So, lets say we select multiple dates and multiple locations then we must get the sum.

For example if i select 2 dates in a month and 1 location then i must get the sum of tran count for those 2 dates in that location.

Thanks

hic
Former Employee
Former Employee

So, the dates represent weeks and are additive? E.g. if I have one location and two dates, the [Transaction Count] should be summed.

And If I have one date and two locations, the [Transaction Count] should also be summed.

Then it sounds to me as if the [Transaction Count] is additive both over the time dimension and the location dimension? So you can use Sum([Transaction Count]) straight off? Or what am I missing?

HIC

Not applicable
Author

if i use the sum(transaction count) i see a huge number popping up..if you can see in the text box we can see that i am not sure why?

hic
Former Employee
Former Employee

And what makes you think that this number is wrong? You have 233 locations of which many have a total of more than a couple of thousands.

HIC

Image6.png

Not applicable
Author

if i pick 2 dates and one location i see 2 values in the transaction count text box and i want to see the sum of those 2 in the text object but i dont see that,And i think there is some problem with my load script.Can you take a look at it and let me know.

Thanks

hic
Former Employee
Former Employee

Two dates and one location. In the case below, you have 256 and 257 as transaction counts. Is 483 the number you want?

HIC

Image7.png

Not applicable
Author

Yep exactly, may i know how did you achieve it?

Thanks

hic
Former Employee
Former Employee

The chart uses

=Sum([Transaction Count])

and the blue text box uses

=Sum({<TransactionChannelDesc ={POS},TransactionTypeId = {1}>}[Transaction Count])

HIC