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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
mweiherer
Contributor
Contributor

Min, Max or Avg of a calculated field

Hi everyone, 

I´m rather new to Qlik Sense so forgive me if I got something wrong. 

I have following problem: 

- I have Data for several deadlines which contains a column of datapoints and a column of the corresponding values.

   The loading statement is as followed: 

LOAD
Date(Date#(Right(FileBaseName(), 8), 'YYYYMMDD'), 'MM.YYYY') as Datum,
Positionsnummer,
Wert

FROM [lib://.../xyz_*.xlsm]
(ooxml, embedded labels, table is DATEN);

- Beside that I loaded a table with some dimensions  

- I now want to calculate some KPI´s from the datapoints, wich works completely fine. For example: 

=if(Dimension='Cost-income ratio', (Sum({<Datum={'$(=max([Datum]))'}, Positionsnummer ={'6150000'}>} [Wert]) + Sum({<Datum={'$(=max([Datum]))'}, Positionsnummer ={'6160000'}>} [Wert])) / Sum({<Datum={'$(=max([Datum]))'}, Positionsnummer ={'26'}>} [Wert]))

But I now have following problem: 

I want to add more fields containing the min, max and avg of the calculated KPI´s over time. 

Do you guys have a solution for this because I simply don´t get it at the moment. I´ve tried many things but nothing works. 

Thanks in advance!

Labels (2)
1 Reply
vinieme12
Champion III
Champion III

create a dummy dimension in your data model like below

Dummy:

Load * Inline [

Dim,DimText

1,Cost-income ratio

2,Min

3,Max

4,Avg

];

 

in your Charts use Dimension = Dual(DimText,Dim)

 

Expression = 

Pick( Dim ,

expression for when Dim = 1 ie Cost-income ratio

,expression for when Dim = 2 ie Min

,expression for when Dim = 3 ie Max

,expression for when Dim = 4 ie Avg

)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.