Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
fcecconi
Partner - Creator III
Partner - Creator III

Help with selecting a single row for an expression

Here is what my measure table looks like

User_IDMetricValue
1Sales100
2Sales150
3Sales75
1Cost50

I am joining the measure table to another table on the user_id

I want to create a straight table and have a column for sales and cost for each user id.

Something like this

User LocationSalesCost
TomHome Office10050
SteveField150
MaryField50

Thanks!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Add User and Location as dimensions to your straight table and use as expressions:

Sales: sum({<Metric={'Sales'}>}Value)

Cost: sum({<Metric={'Cost'}>}Value)


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
robert_mika
Master III
Master III

Could you post your data?

Gysbert_Wassenaar

Add User and Location as dimensions to your straight table and use as expressions:

Sales: sum({<Metric={'Sales'}>}Value)

Cost: sum({<Metric={'Cost'}>}Value)


talk is cheap, supply exceeds demand
martinpohl
Partner - Master
Partner - Master

Hello!

Create a chart / straight table   >>>next

then add your dimensions User and Location          >>>next

add a formula sum({<Metric={Sales}>} Value)

and a second formula with the syntax a formula sum({<Metric={Cost}>} Value)

Then give both a label and maybe format the numbers

finish

Regards

fcecconi
Partner - Creator III
Partner - Creator III
Author

Thanks Martin

fcecconi
Partner - Creator III
Partner - Creator III
Author

Gysbert

I was trying what you suggested, but everything was summing up to be the same value.  What I noticed was that I had a loop in my model.  Once I removed the loop, everything worked as expected..