Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
cristian_av
Creator III
Creator III

Order with Match not working

Hi

I have a graph where I use the following order expression:

=Match(espe_Agrupado2,'Manzanas','Cerezas','Arandanos','KiwiFruit','Ciruelas','Peras','Nectarines','Duraznos')

And the following expression:

=Sum(VolumenReal)

When I use this expression, the order works as expected.

But when I change the expression to this one, the order is just ignored. (It's a big expression, not sure if it is the best way, but at least it works)

=((Sum({<PeriodoNumVol = {">=$(=min(PeriodoNum))<=$(=max(PeriodoNum))"},ctmv_codigo={$(=REPLACE('330',';',','))},espe_nombre2={$(VolumenEspecieNormal)},[OrigenVol]={'Vol.Real'},TipoVol={'OriginalTotal'},PeriodoNum=,Periodo=,Mes=>}VolumenReal))/1000)

/(((Sum({<PeriodoNumVol = {">=$(=min(PeriodoNum))<=$(=max(PeriodoNum))"},ctmv_codigo={$(=REPLACE('330',';',','))},espe_nombre2={$(VolumenEspecieNormal),$(VolumenEspecieJugo)},[OrigenVol]={'Vol.Real'},TipoVol={'OriginalTotal'},PeriodoNum=,Periodo=,Mes=>}VolumenReal))/1000)

+ $(VolumenTotal(375,{'Vol.Real'}, ))

)

any idea about why the order could be ignored?

borrar.png

6 Replies
swuehl
MVP
MVP

Try adding the set expression to your sor expression:

=Only(

{<PeriodoNumVol = {">=$(=min(PeriodoNum))<=$(=max(PeriodoNum))"},ctmv_codigo={$(=REPLACE('330',';',','))},espe_nombre2={$(VolumenEspecieNormal),$(VolumenEspecieJugo)},[OrigenVol]={'Vol.Real'},TipoVol={'OriginalTotal'},PeriodoNum=,Periodo=,Mes=>}

Match(espe_Agrupado2,'Manzanas','Cerezas','Arandanos','KiwiFruit','Ciruelas','Peras','Nectarines','Duraznos')

)

cristian_av
Creator III
Creator III
Author

Hi

Didn't work! the values dissapears when I put Only().. No idea why!

rubenmarin

Hi, maybe setting the sort expression as:

Match(only({1} espe_Agrupado2),'Manzanas','Cer...

cristian_av
Creator III
Creator III
Author

That worked!! Could you please explain what does only({1} ) do?

I don't understand! thanks!!

(I don't know why, but I can't set the answer an "Correct Answer". The option just vanished!)

rubenmarin

Hi, the {1} says to ignore all selections or filters, so they are sorted always in the same way. I usually set it when I'm sorting values by expression (and the sort should be always the same)

emroenor
Contributor
Contributor

Hi, the {1} is not working for me. I used this Expression but the graph is not displaying in the right order.

Match(Only({1} [3M Next Milestone]),'Pre Imp: Quote Request', 'Pre Imp: TRR', 'Pre Imp: Site Survey','Pre Imp: HLD + BOM','Pre Imp: SOW/Proposal & PO', 'MS1: Project Kick-off', 'MS2: Eng Design + LLD/Workpack', 'MS3: Equipment Ordering', 'MS4: Equipment Delivery', 'MS5: Site Remediation', 'MS6: Implementation Preparation', 'MS7: Implementation', 'MS8: ORT/NOC Handover', 'MS9: Project Closeout') 

Can you help me on this? Thanks.