Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Tina_Bran
Contributor II
Contributor II

Fill in fields

Hi!

Could someone please help me find the best way to solve this problem. I don't know if it's more convenient to do it by script or by expression.

My data set is:

Tina_Bran_0-1653654457783.png

The objective is to complete for item 3 the data of the attribute1 and attribute2 fields with the same information that the other items have. Then the user will be able to filter by attribute1 or attribute 2 and will not lose the record with item_p 3

Tina_Bran_1-1653654504596.png

Regards.-

Labels (1)
3 Replies
edwin
Master II
Master II

does this mean there is some hierarchy to the items?  that items 1 and 2 belong to item3?  this should be modeled in your DM, that there should be some attribute that says item 3 is the parent of 1 and 2.  so add a field , Relationship for example, where items 1 and 2 are children and item 3 is parent, you can create a table with the following measure:

if(Relationship='parent', aggr(nodistinct concat(distinct attr1),id_p), only(attr1))

edwin_1-1653672742688.png

 

sample data:

edwin_2-1653672784623.png

 

 

 

edwin
Master II
Master II

this means if item is a parent, aggregate the attribute column and apparently, since there is only one value for attr1 for all the children, the aggregation will return attr1 for the children, else return the attr1 which isnt aggregated.

this assumes that the children will always have the same attr1 

Tina_Bran
Contributor II
Contributor II
Author

Edwin, thanks for your answer. I was testing the expression and I find the following problem. When I filter "door" or "Window" the parent row is lost

The objective of completing this data is to be able to filter and not lose the parent row.