Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Disconnecting references between tables

I understand that QV automatically connects all tables that use identical field names. Unfortunately, for a specific task I'd need to use identical field names in two different tables, which are not and shall not be connected to each other. Connecting them would result in circular references.

Is there any chance to use the same field name at two different tables and prevent QV from connecting them?

9 Replies
Not applicable
Author

sure use QUALIFY before the table and name the fields

Anonymous
Not applicable
Author

Marcus,

No, but you can have fields that look identical, for example:

"Product" and "Product "

Notice the space at the end of the second name.

Anyway, it is hard to imaging whay oyu can't just use labels.  Besides, if you name fields as I showed above, it will be hard for to choose the correct field in dimensions and expressions.

Regards,

Michael

Not applicable
Author

Reason for identical field names is that I use Multiboxes as central elements in my application. See the screenshot below. Multiboxes can only list fields. Users select price categories "low price", "mid price" and "high price". Those categories are used both in retail sales and label accounting; two totally different departments which mustn't be connected to each other.

If those two tables can't be kept separate, this would mean to add "pricing sales" and "pricing LA" as two separate elements in my multiboxes, which is kinda annoying in terms of useability.

QV Server - 172.16.1.png

Anonymous
Not applicable
Author

You can name your fields "pricing sales" and "pricing LA", but use label "Pricing" for both.

Not applicable
Author

Still, this would result in two separate Multibox fields, wouldn't it?

Anonymous
Not applicable
Author

Marcus,

You want two different fields shown as one?  It is quite a different story.

First, that means that they are logically connected.  The question is about the appropriate data model.

Second, it is possible to implement even if you have a  reason to keep them separately.  For example, in addition to pricing sales" and "pricing LA", you can create field "Pricing" as a logical data island to use it in multibox.  Selection in "Pricing" can be copied into the "real" pricing fields by a macro.  Or, use conditions and/or set analysis expresions to enforce the deiserd behavior, e.g.

if("pricing sales"=Pricing...)

I recommend to resolve it in a data model, that is use one field.

Regards,

Michael

Not applicable
Author

Second, it is possible to implement even if you have a  reason to keep them separately.  For example, in addition to pricing sales" and "pricing LA", you can create field "Pricing" as a logical data island to use it in multibox.  Selection in "Pricing" can be copied into the "real" pricing fields by a macro.

This would be a good solution. How to create such a data island?

Anonymous
Not applicable
Author

It depends.  If it is a st of fixed values (high, mid, low), it is:

Pricing:

LOAD * INLINE [

     Pricing

     High

     Mid

     Low];

If it is not fixed but depend on the other pricing fields, it could be like this:

Pricing:

LOAD DISTINCT "pricing sales" as Pricing RESIDENT Sales;

CONCATENATE (Pricing)

LOAD DISTINCT "pricing LA" as Pricing RESIDENT LA;

No field with the same name anywhere in the data model, so it is not connected to anything.

Not applicable
Author

I'll give it a shot. If this works, it would be a perfect solution for various tasks.