Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
AMorella
Contributor II
Contributor II

Fields As Measures

Is there a way to have non-aggregated data show as bars in a combo graph?

I'm building an app to track stock level activity by product group (multiple SKUs). The plan is to compare year over year activity by taking the End Inventory for each year. I want to show the current year, previous year and delta for each product group.

The issue I'm having is there is one End Inventory number for each product group and I don't know how to make it graph because Qlik seems to require a calculation to do this (Sum, Count, etc.).

For the "measure", I'm using {<[Activity.Inv Type] = {"Import"}>} [Activity.End TCO]

Any help would be very much appreciated!

Labels (1)
6 Replies
Or
MVP
MVP

A measure is always aggregated, but you can use Only() as an aggregation.

AMorella
Contributor II
Contributor II
Author

I tried Only([Activity.End TCO]) and it doesn't graph. No value is given unless I sum. 

anat
Master
Master

Only() returns a value if there is one and only one possible result from the aggregated data. For example, searching for the only product where the unit price =9 will return NULL if more than one product has a unit price of 9.

 

AMorella
Contributor II
Contributor II
Author

OK, thank you. My issue is there's 1 data point for each product group for each month of the year. I need only the most recent one for each year to be shown (when looking at the year). So, December, and the most recent month for the current year.

The graph shows data in year format but can be broken down to monthly. Is there a way to show 12/2023 and 2/2024 (for example) in the "Year" view; and then have the "Month" view still show the individual month data?

Or
MVP
MVP

Have a look at using FirstSortedValue(), then, perhaps.

AMorella
Contributor II
Contributor II
Author

Or,

Unfortunately, that gives no value. I took out the conditions and just went for the total value, sorted by Month - which is a numeric field - but it doesn't produce a result. The result is "The chart is not displayed because it contains only undefined values.

Code:

{<[Activity.Inv Type] = {"Location"}>} FirstSortedValue([Activity.End TCO] ,[Activity.Month], 12)

Meant to show December ending inventory, based on the named location.