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

convert measurement into dimension with aggr

Hi guys,

I have this nested if statement as measurement to show what type of product is .

I searched community, seems since without aggr function, it only returns value; but I need a result of dimension.

so how I work with aggr to convert this into a result of dimension?

 

if(vGP%forProfile > vGP% and vMS% > vMKT%, 'A',

if(vGP%forProfile > vGP% and vMS% < vMKT%, 'B',

if(vGP%forProfile < vGP% and vMS% > vMKT%, 'C')))

5 Replies
Anil_Babu_Samineni

We may aware, If you can define the variable what it do? Please share your variable expressions as well.

Best Anil, 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
coloful_architect
Creator II
Creator II
Author

hi Anil,

I am so happy with your asking, you know what ....I can NOT  get set expression work as I expect by using  vGP%forProfile and vMS% ( I post like this way is to simplify my question)

for some reason as long as I use created variable, it just does not work. I end up using the original formula. But I guess this is another question. but if you could shred some lights on it, much appreciated. and master measure seems not work either unless I missed something. 

 

so vGP%forProfile:

       GP/Net Sales

     vMS%: 

$< [Company]={'US'},Date={'$(=max([Date]))'} >} [UNITS] ) /
Sum( {$<[Company]=,Date={'$(=max([Date]))'} >} [UNITS])

     vGP% and vMKT% are numbers I manually set 

I am now getting good result with that product type but not a ideal result as dimension. I want to have that magnifier logo at the table so that users can filter and search what they want.

thanks 

Anil_Babu_Samineni

What If, you are defining this way simply?

Aggr(Your expression, Dim1, Dim2)

Best Anil, 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
coloful_architect
Creator II
Creator II
Author

what Dim1 and Dim 2 refer to here ?  'A', 'B', 'C' ? those product type I want to categorize ? 

coloful_architect
Creator II
Creator II
Author

just wanted to add that ‘A’, 'B' , 'C' ,'D' (product type) are not data at my dataset.

I just wanted to use if statement to give those products ( those are at my dataset) new different category names.

do you think I need to create a mastered dimension  or variable for those A, B, C, D to make the formula work?