Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
WE ARE LISTENING! New Navigation for Qlik Community, Sept. 26: TELL ME MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
saminouari
Contributor III
Contributor III

If Wildmatch Sum

Hi,

I have a category named TOOTHBRUSH, and i want to sum only the products that are equal to the brand AQUAFRESH and exclud the other products.

I have to do the same thing for the rest of produtcs.

Sum only products that begin with AQUAFRESH

Sum only products that begin with PARODONTAX

Sum only products that begin with PROGLASUR

Capturegsk.PNG

 

Labels (2)
1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

Yes a set analysis (set expression) does not work in a load script only in the UI. So I suspect that you are trying to do this in a load script then?

So based on WildMatch() you could do this to categorize or make a grouping field:

Pick( Wildmatch( Nor , 'AQUAFRESH*' , 'PARODONTAX*' , 'PROGLASUR*' ) , 'AQUAFRESH' , 'PARODONTAX' , 'PROGLASUR' )) AS ProductGroup

 

 

View solution in original post

5 Replies
petter
Partner - Champion III
Partner - Champion III

Use a set expression instead:

 

Sum( {<Nom={'AQUAFRESH*','PARODONTAX*','PROGLASUR*'}>} Sales)

saminouari
Contributor III
Contributor III
Author

It's not working, I would really like to group all the produtcs that begin with AQUAFRESH for example to create  a subcategory, it makes it easier then to sum the wanted products .

kashyap311996101
Partner - Specialist
Partner - Specialist

Hi

Try creating the master dimension or create seperate field in the scrpit

If(Wildmatch(Nor,'AQUAFRESH*','PARODONTAX*','PROGLASUR*')=1,'AQUAFRESH',

If(Wildmatch(Nor,'AQUAFRESH*','PARODONTAX*','PROGLASUR*')=2,'PARODONTAX',

If(Wildmatch(Nor,'AQUAFRESH*','PARODONTAX*','PROGLASUR*')=3,'PROGLASUR')))

Hope this helps

Thanks

 

 

Thanks and Regards
Kashyap.R
petter
Partner - Champion III
Partner - Champion III

Yes a set analysis (set expression) does not work in a load script only in the UI. So I suspect that you are trying to do this in a load script then?

So based on WildMatch() you could do this to categorize or make a grouping field:

Pick( Wildmatch( Nor , 'AQUAFRESH*' , 'PARODONTAX*' , 'PROGLASUR*' ) , 'AQUAFRESH' , 'PARODONTAX' , 'PROGLASUR' )) AS ProductGroup

 

 

saminouari
Contributor III
Contributor III
Author

Hi,

I did solve the problem, I created a new dimension named Subcategory in the data load editor with the help of  Wildmatch.

wildmatch.PNGThe script : if(ProductRangeCode='TOOTHBRUSH' and WildMatch(ProductName,'*AQUAFRESH*'),'AQUAFRESH') as SubCategory