Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Issue

I have the following formula in Expression :

sum(price)/sum(total{<user, region>})price)

This works if In Qlikview I have a value on the price column selected. ( I have the percentage selected in the Number tab )

But as soon as I uncheck the value in the price column the expression becomes 0.

any suggestions pls.

Thanks

8 Replies
Gysbert_Wassenaar

It's pretty amazing it returns anything at all. The parentheses don't match up.

sum(price)/sum(total{<user, region>})price)

And {<user, region>} doesn't do anything. Maybe you mean sum(price)/sum(total <user,region> price). If not you'll have to explain what you want. Start with your showing some source data and then show what the result table should look like.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks a lot.

Removing the {} from the expression resolved the issue.

So now I have columns looking like  ( In a pivot table )

User                Price               Fruits               Expression

here expression has the percentage of each fruit for this specific user.

for this the formula used is :

sum(price)/sum(total<user, fruits>price)

this works.

Now is it possible to sort this based value in the expression ? High to low ?

Not applicable
Author

Thanks a lot.

Removing the {} from the expression resolved the issue.

So now I have columns looking like  ( In a pivot table )

User                Price               Fruits               Expression

here expression has the percentage of each fruit for this specific user.

for this the formula used is :

sum(price)/sum(total<user, fruits>price)

this works.

Now is it possible to sort this based value in the expression ? High to low ?

Not applicable
Author

Thanks a lot.

Removing the {} from the expression resolved the issue.

So now I have columns looking like  ( In a pivot table )

User                Price               Fruits               Expression

here expression has the percentage of each fruit for this specific user.

for this the formula used is :

sum(price)/sum(total<user, fruits>price)

this works.

Now is it possible to sort this based value in the expression ? High to low ?

Gysbert_Wassenaar

Pivot tables are somewhat picky when it comes to sorting. You can try setting the sort option of the first dimension to sort by Y-value. That should sort the pivot table using the values of the first expression.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you again.

How would I do it if this was a straight table ?

Gysbert_Wassenaar

Move the expression to the top of the sort priority list on the Sort tab of the properties window.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you very much.

It worked.