Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Eliobel
Partner - Contributor II
Partner - Contributor II

Using ONLY Meassure as a Dimension for Filter Panel

Hi, i'm working on Qlik Sense Enterprise trying to use my meassure as a dimension.

I have a products table with the columns CodEAN (Barcode) and Producto (Name).

Eliobel_0-1719610358409.png

Products have associated fields like "Principio Activo", Concentación and "Forma Médica".

Right now after i choose one product, i populate another table with the dimensions CodEAN, Producto and "Forma Médica" all the products that share the same Concentación and "Principio Activo" using P() like this

SUM({<CodEAN=,ProductoLab=,            
            CodEAN = P({1<[Principio Activo] = P({<CodEAN = {"$(vCodEANSel)"}>} [Principio Activo]),
                        [Concentración]  = P({<CodEAN = {"$(vCodEANSel)"}>} [Concentración])>} CodEAN)>} Venta2024)

vCodEANSel is a variable with "GetFieldSelections(CodEAN)"

Eliobel_1-1719610814032.png

After the first CodEAN is selected, i'm trying to create a "dinamic filter" that let me choose between all the possibles CodEAN associated with my initial CodEAN with their possible values like so. 

ONLY({<CodEAN=,ProductoLab=,            
            CodEAN = P({1<[Principio Activo] = P({<CodEAN = {"$(vCodEANSel)"}>} [Principio Activo]),
                        [Concentración]  = P({<CodEAN = {"$(vCodEANSel)"}>} [Concentración])>} CodEAN)>} CodEAN)

If i use that formula as a Meassure it works with my test table showing in the "Asociados" column. So i know my meassure get correctly all the associated CodEAN from my initial selected CodEAN by their possible Concentración and "Principio Activo"

Eliobel_2-1719611818409.png

¿Is there a way that my Only() formula that use P() be used as a dimension on a Filter Panel?

Thanks in advanced

Labels (2)
4 Replies
marksouzacosta
Partner - Specialist
Partner - Specialist

Hi @Eliobel,

I don't think you can do that. However, I have a personal rule that says, "if my expressions are too complex, maybe I can improve my Data Model".

Can you somehow create this relationship of records in your Data Model, in a way that you can actually have a dimension instead of a measure?

Have you heard about the Semantic? This statement may help you on this challenge. There is a nice article about it here: https://qhic.se/2023/04/12/semantic-links/

 

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
marcus_sommer

Each aggregation could be used as (calculated) dimension by wrapping them with an appropriate aggr(), like: aggr(Exp, Dim) - but it won't behave like native fields and it couldn't compensate any gaps in the data-model. Therefore it should be rather the worst case approach if no other way is possible or practicably.

In your case I could imagine that's more suitable to increase the categorizing - n hierarchically dimensions more and/or using also overlapping dimensions - here the idea with an example: The As-Of Table - Qlik Community - 1466130.

Eliobel
Partner - Contributor II
Partner - Contributor II
Author

Hi Mark. I didn't know about semantics and i think i'll use it in the future but sadly this isn't the case. The relations between my data isn't hierarchical like parent/child.

Right now i'm trying to convince the right people to rearrange the data because honestly i didn't know how to handle the filter as they want it.

I can make multiples loads of the same table with different fields names to adjust the Data Model as you say but right know i'm limited on server resources.

Thanks anyway, appreciated the advices.

Eliobel
Partner - Contributor II
Partner - Contributor II
Author

HiMarcus. My bad, i forgot to say it but yeah, i used AGGR and Master Dimensions in my example but for Qlik it seems like that's not 100% a real dimension and it behave kinda weird.

i'll see your post and try new stuff with your suggestion and @marksouzacosta.

Thanks for the advice.