Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
krmvacar
Creator II
Creator II

Qliksense show total on pivot table in kpi

I have a calculation on the pivot table and I'm trying to show the total area in kpi, but I'm not getting the correct result. Can you help?

I have 4 dimension  and 1 measure.

KPI expression:

SUM(AGGR(avg(num([SIPARISTARIHI])-num([REQUISITIONDATE])),[OLPALPPOT04.SIPARISTIP],[OLPALPPOT04.SIPARISNO],OLPALPPOT04.PURDEPTTEXTORDERNEW, OLPALPPOT04.DEPDURUM))

Reuestday measure: 

[OLPALPPOT04.SIPARISTIP],[OLPALPPOT04.SIPARISNO],OLPALPPOT04.PURDEPTTEXTORDERNEW, OLPALPPOT04.DEPDURUM

avg(num([SIPARISTARIHI])-num([REQUISITIONDATE]))

Dimensions: 

but it doesn't give the same result  

 

krmvacar_0-1682688666424.png

 

Labels (4)
5 Replies
Chanty4u
MVP
MVP

May be try this 

 

SUM({< [OLPALPPOT04.SIPARISTIP] = {'somevalue'}, [OLPALPPOT04.SIPARISNO] = {'anothervalue'} >} AGGR(avg(num([SIPARISTARIHI])-num([REQUISITIONDATE])),[OLPALPPOT04.SIPARISTIP],[OLPALPPOT04.SIPARISNO],OLPALPPOT04.PURDEPTTEXTORDERNEW, OLPALPPOT04.DEPDURUM))

 

krmvacar
Creator II
Creator II
Author

Hi ,

thank you for replying.

I try but ıts not working.

SUM({< [OLPALPPOT04.SIPARISTIP] = {'somevalue'}, [OLPALPPOT04.SIPARISNO] = {'anothervalue'} >}

Somevalue and anothervalue I don't understand why you used.

my measure only this:

avg(num([SIPARISTARIHI])-num([REQUISITIONDATE]))

Can you help?

Chanty4u
MVP
MVP

Try this 

avg(aggr(num(SIPARISTARIHI)-num(REQUISITIONDATE), SIPARISTIP, SIPARISNO, PURDEPTTEXTORDERNEW, DEPDURUM))

 

 

Check if the measure is being aggregated correctly. If you are using a measure with dimensions, make sure that the measure is being aggregated appropriately for each dimension. For example, if you are using the "avg" function, make sure that the measure is being averaged over the correct dimensions.

krmvacar
Creator II
Creator II
Author

Thank you for reply.

But its not workıng.

Your expression give me result 5 but must be 6.9

I send qvf file.

Can you check this?

Chanty4u
MVP
MVP

I'm unable to open qvf due to restrictions try this out

avg(aggr(num(SIPARISTARIHI) - num(REQUISITIONDATE), (SIPARISTIP, SIPARISNO, PURDEPTTEXTORDERNEW, DEPDURUM)))

May be possible reasons

Data type: Make sure that the fields SIPARISTARIHI and REQUISITIONDATE are numeric fields. If they are not, you can use the num() function to convert them to numeric values.

 

Aggregation: Check if the aggregation used in the expression is appropriate for your data. The aggr() function is used to aggregate data based on one or more dimensions. Make sure that the dimensions SIPARISTIP, SIPARISNO, PURDEPTTEXTORDERNEW, and DEPDURUM are correct and are providing the necessary granularity for the calculation.