Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
reporting_neu
Creator II
Creator II

Mapping - Value must not match

Hello,

is there a way to add data with certain conditions? When mapping, I always looked for matches. But now I need exactly the opposite. Like here for example:

 

Mapping:
Mapping Load
Project & '-' & <> Order & '-' & Part & '-' & > Date,
...
Resident XYZ;

The project should match. The order must not match and the date must be larger.

Which one of you can please help me?

Labels (2)
3 Replies
Dataintellinalytics

Mapping alone may not be enough to implement your requirement, try with combination of if statement or mapping or any other business logic condition.

Also please share more details on the requirement with sample input and expected output data for the community to help you.

reporting_neu
Creator II
Creator II
Author

Thanks for your answer.

I'll try to describe it:
I need to find out which parts were ordered in difference projects, then not delivered, but were ordered again through a new order and then delivered. The order must always belong to a project.

We have the following data:

  • Project
  • Order
  • OrderDate
  • Part
  • Quantity

Example:

Projekt 1
Order 3001
OrderDate 2024-03-15
Part 12345
Quantity 10
not delivered

Projekt 1
Order 3002
OrderDate 2024-03-16
Part 12345
Quantity 10
delivered

marcus_sommer

A mapping worked only with exact matches which means you couldn't directly apply the lookup like shown. Are there any range-areas needed it requires to extend the mapping-table for them respectively to resolve the ranges to dedicated values.

A quite common approach for such scenarios is the use of internal while-loops, like:

m: mapping load Key & '|' date(Start + iterno() - 1), Return
from Source while Start + iterno() - 1 <= End;

If it's possible with your data to resolve the Order & Date in this way and/or applying other measurements to add extra information like the min/max values and/or a count and/or any accumulation ... ? Further useful and important is that mappings could be nested - in the table as well as within the call. This means multiple lookup-values could be loaded for a single query and also multiple queries against a single lookup-value.

From a logically point of view the above loop-example is already such a nesting because each Key is combined with n dates to ensure respectively to increase the likely that the query would find a match. The reverse is possible within the query with something like:

applymap('m', Key & '|' today(), applymap('m', Key & '|' date(today()-1), ...))

By each kind of nested approaches the order of the execution is important and could be targeted used to get the wanted results.