Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Manipulating data

Hi everyone,

I'm new with Qlikview and i have some problems, specialy with expressions.

I have Two files like that :

file1

Product
Price
117
219
321
423

file2

ClientProduct
Client 11
Client 12
Client 21
Client 13

I want to calculate How much one client spent and display it, so i want to declare a new variable "depense" wich be like that sum(count(products)*price).

I want to know how to do this.

thanks for your answer

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You'll need to change the expression to sum(aggr(Price*count(Client),Product,Client))


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Not applicable
Author

Hi,

try this expression^^

sum(aggr(count(Product)*Price,Product,Client))

Regards,

Alex

Gysbert_Wassenaar

It's not clear to me if Product is a count or a product id. Depending on what's what there are different solutions. See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks for your answers,

it helped me, but there is still confusion.

If for exemple Client 1 bought the same product in an another day :

ClientProductDate
Client 111/1/2013
Client 122/1/2013
Client 213/1/2013
Client 114/1/2013

If i do the sum, Qlikview will eliminate a double. how to fix that?
I want to notice that Product is an ID.

Best Regards,

Gysbert_Wassenaar

You'll need to change the expression to sum(aggr(Price*count(Client),Product,Client))


talk is cheap, supply exceeds demand