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

Aggregate Function

Hi All,

i have the following data structure.

I would like to create new dimension that works in the following way:

If at "order number" level there's one item number that starts with PPT170* then the new dimesion needs to be 'PPT Item' otherwise use "CustomDescription".

 

i used this formula but is not working:

=Aggr(If(Match(ItemNumber,'PPT170*'),'PPT Item',CustomDescription),Order_Number)

 

any idea?

 

forum.PNG

10 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi 

try with 

=Aggr(If(Match(Left(ItemNumber,6),'PPT170'),'PPT Item',CustomDescription),OrderNumber,ItemNumber)

asinha1991
Creator III
Creator III

so if I understand you correct, this new dimension will be at order level right?

try this

 

=if(Aggr(count(If(wildmatch(ItemNumber,'PPT170*'),CustomDescription)),Order_Number)>0,'PPT Item',CustomDescription)

qlikviewaf
Creator
Creator
Author

With this formula, only the item PPT17014 is set as "PPT Item"; i would like to have all items belonging to the same order number having PPT Item.

I explained my self?
Thank you

forum 2.PNG

qlikviewaf
Creator
Creator
Author

With this formula, only the item PPT17014 is set as "PPT Item"; i would like to have all items belonging to the same order number having PPT Item.

I explained my self?
Thank you

asinha1991
Creator III
Creator III

did you try what I suggested?

 

this should work at order level

qlikviewaf
Creator
Creator
Author

yes, i tried, exactly same results.. 

StarinieriG
Partner - Specialist
Partner - Specialist

Could you create a new dimension inside script? 

qlikviewaf
Creator
Creator
Author

yes i can

asinha1991
Creator III
Creator III

maybe this

=if(Aggr(alt(count(Total If(wildmatch(ItemNumber,'PPT170*'),CustomDescription)),0),Order_Number)>0,'PPT Item',CustomDescription)