Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rafaeloneil
Contributor III
Contributor III

Doubt expression Line Chart in QlikView

Guys, good afternoon, I'd like to know how you can help me.


I have the following table:

     Table.png

I need to create a Line chart for each REGIONAL where only the last photo of each month is always counted


In this way, I inserted the following specifications in the chart:

Dimension: DTFOTO

Expression: SUM({$<REGIONAL={'A'}>} PEND_TOTAL) / SUM({$<REGIONAL={'A'}>} CART_TOTAL)


With the above expression, I get the percentage calculation of all the photos, however I need the chart to only count the last photo of each month (11/30/2016 and 12/30/2016)


Can you help me?

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

=SUM(Aggr(FirstSortedValue({<REGIONAL = {'A'}>}PEND_TOTAL,-DTFOTO),MESFOTO,ANOFOTO))/

SUM(Aggr(FirstSortedValue({<REGIONAL = {'A'}>}CART_TOTAL,-DTFOTO),MESFOTO,ANOFOTO))

View solution in original post

5 Replies
MK_QSL
MVP
MVP

what could be the end result looks like?

Can you provide here?

sunny_talwar

May be this:

SUM({$<REGIONAL={'A'}>} Aggr(If(Only({$<REGIONAL={'A'}>} DTFOTO) = Max({$<REGIONAL={'A'}>} TOTAL <MESFOTO, ANOFOTO> DTFOTO), PEND_TOTAL), DTFOTO, MESFOTO, ANOFOTO)) / SUM({$<REGIONAL={'A'}>} Aggr(If(Only({$<REGIONAL={'A'}>} DTFOTO) = Max({$<REGIONAL={'A'}>} TOTAL <MESFOTO, ANOFOTO> DTFOTO), CART_TOTAL), DTFOTO, MESFOTO, ANOFOTO))

MK_QSL
MVP
MVP

=SUM(Aggr(FirstSortedValue({<REGIONAL = {'A'}>}PEND_TOTAL,-DTFOTO),MESFOTO,ANOFOTO))/

SUM(Aggr(FirstSortedValue({<REGIONAL = {'A'}>}CART_TOTAL,-DTFOTO),MESFOTO,ANOFOTO))

sunny_talwar

I think it might not work because there are more than 1 DTFOTO for a combination of MESFOTO and ANOFOTO. FirstSortedValue will have trouble showing a single value here

rafaeloneil
Contributor III
Contributor III
Author

Thanks guys, I worked with the received guidance