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

Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Sapphire
Contributor III
Contributor III

Selecting specific values in Measure-Columns for Reports

Hi there!

I have an Issue regarding the use of Measures (and maybe a bit of a lack of understanding as to what the underlying reasons are for this Issue to arise).

 

My Task:

I have a set of data, containing the IDs of Cars and different codes for service options that have to be done to this cars, as well as the status of these service options. One ID can either have one or more of the same service options at the same time. Now I want to create a table that lists all Car-IDs that have more than one service option open at the same time.

To achieve this, I wanted to simply create a measure counting all service options per ID that are in a defined set of status. This works, but so far shows also the IDs that only have 1 service option per ID.

 

My Problem:

I don`t know how to filter measures, since I can`t just say "select all values bigger 1". When putting it in an expression, I get the error "invalid Dimension".

My second try was to go via an expression like i.e. "=if(count(serviceOption)>1, serviceOption,null())" and then simply hide zero-values which, however, only works with dimensions, not measures.

 

So now my Question sums up basically into: How can i select or filter specific values in measure columns in tables (Like either "show only value "x" or "show greater than x")?

 

 

I once again hope on your ability to help me! 🙂

Faithful regards,

Daniel

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Sapphire 

My bad - I missed "=" sign in my previous post hence it didnt work for you there - I have updated it in my previous post.

Here you have your example. Important thing is to understand the context here. In your exxample You can only filter "count(ServiceID)>1" against the VehicleId dimension. Think about using advanced search with measure like about creating virtual table in memory with the dimension you filter, measure and condition. In your case it is:

  1. Dimension: VehicleID
  2. Measure: Count(ServiceID)
  3. Condition > 1

Lech_Miszkiewicz_2-1732745798105.png

This can be validated also as a filter on VehicleID field - as you can see it returns 234 as the only result meeting the criteria:

Lech_Miszkiewicz_3-1732745928941.png

And below whole example:

 

Lech_Miszkiewicz_0-1732745414197.png

And In NPrinitng filter would be just:

Lech_Miszkiewicz_1-1732745483677.png

This example is very easy and does not create data granularity challenges which i described in my blog post. Those have to be considered when using more advanced searches.

Attaching sample app so you can have full picture. Hope this is now super clear.

cheers

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

10 Replies
henrikalmen
Specialist II
Specialist II

I suggest you create a new field in the data model, that holds a counter for each ID.

Sapphire
Contributor III
Contributor III
Author

Hello Henrikalmen,

 

I agree this would be most likely the best solution. However, I have the problem that in our company I can`t just modify the loading script or data model due to different reasons and our policy, hence I have to rely on "front end solutions", sadly.

 

henrikalmen
Specialist II
Specialist II

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Sapphire 

Why dont you use set analysis with advanced search?

Count({<ID={"=Count(ServiceID)>1"}>}WhateverYouWantToCount)

Sum({<ID={"=Count(ServiceID)>1"}>}WhateverYouWantToSum)

EDIT:

I missed important "=" sign, added now

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Sapphire
Contributor III
Contributor III
Author

Heya,
Thanks for your suggestions, I will look into that, maybe it might help. And, even if not, at least I will have learned something new, then.

Sapphire
Contributor III
Contributor III
Author

Hi,
thank you for the suggestion, I'll try that and see if it works. Just for my understanding: This solution should work both in the App and as a filter-condition in nPrinting, is that correct? I mean, syntax-wise are both (advanced search in QlikSence and advanced search in nPrinting) the same, as far as I understand it?

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

I dont understand your question. Syntax is sligthly different as what I suggested is a set expression in set analysis which is not the same as "advanced search" search filter or advanced search NPrinting filter.

The solution I suggested was to implement this in the Qlik Sense object as a measure. Object is prefiltered to only show values where there are more than 1 services. At this stage you just bring this object to NPrinting and you dont need to filter anything.

Then if you wish to apply filter in NPrinting using Advanced search the question is which dimension you want to filter and if applying filter on such dimension is sufficient to meet criteria/granularity of the data. I have explained those concepts in my blog post here:

It would very much help if you had particular example we could work with to explain those concepts. Maybe create ctrl+0+0 app and lets talk using that example.

cheers

 

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Sapphire
Contributor III
Contributor III
Author

My question regarding the filter was a more general question to see wether or not I could apply this syntax in nPrinting as well. That thought came to mind because I read your reply just as I was setting up a filter. But indeed, my underlying issue was to find a solution directly in sense. Sorry for the confusion.

As for making an example, let that be the raw Data:

VehicleID ServiceID ServiceDescription

123

CLE CleanWindows
234 CLE CleanWindows
234 CLE CleanDoor
456 CLE CleanDoor
567 CLE CleanWindows


Now, my first step was to just get a second table but without the ServiceDescription and instead the expression "count(ServiceID)". Hence I get for the Vehicle ID "234" the value "2" and for the rest the value "1".

What I do want and need however, is that only the rows with at least a "2" i the "count(ServiceID)" are shown.
If I understand your syntax right, to achieve that, I need to replace "count(ServiceID)" with
"Count({<ID={"Count(ServiceID)>1"}>}ServiceDescription)".
This I tried, and although I get no error, it basically still shows me everything. Most likely I am overlooking something simple, here, but so far I don't see it, yet.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Sapphire 

My bad - I missed "=" sign in my previous post hence it didnt work for you there - I have updated it in my previous post.

Here you have your example. Important thing is to understand the context here. In your exxample You can only filter "count(ServiceID)>1" against the VehicleId dimension. Think about using advanced search with measure like about creating virtual table in memory with the dimension you filter, measure and condition. In your case it is:

  1. Dimension: VehicleID
  2. Measure: Count(ServiceID)
  3. Condition > 1

Lech_Miszkiewicz_2-1732745798105.png

This can be validated also as a filter on VehicleID field - as you can see it returns 234 as the only result meeting the criteria:

Lech_Miszkiewicz_3-1732745928941.png

And below whole example:

 

Lech_Miszkiewicz_0-1732745414197.png

And In NPrinitng filter would be just:

Lech_Miszkiewicz_1-1732745483677.png

This example is very easy and does not create data granularity challenges which i described in my blog post. Those have to be considered when using more advanced searches.

Attaching sample app so you can have full picture. Hope this is now super clear.

cheers

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.