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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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..