Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
asgardd2
Creator III
Creator III

Calculate expression for minimum dimension. (pivot table)

Hello!

I have some misunderstanding about how to create the correct expression.

My data model like this:

  

IDDate_ForeCastForecast
Product 101.09.20164
Product 102.09.20164
Product 103.09.20164
Product 104.09.20165
Product 105.09.20165
Product 106.09.20165
Product 107.09.20166
Product 108.09.20166

...                             ...                               ...

I have pivot table in my dashborad:

I want add new expression in the chart, which calculate Forecast for first date and for each product.


I created a formula, and it calculates the correct, but I think it can be done easier. Could you help me with this?


Aggr(Nodistinct

    AGGR(IF(Date_ForeCast = Min(TOTAL <ID> Date_ForeCast),sum(Forecast)),Date_ForeCast,ID)

    ,ID)


I tried make exprressions ! without If statement, but they are not calculated correctly :

expression2:

AGGR(Nodistinct sum({<Date_ForeCast = {"$(=Min(TOTAL <ID> Date_ForeCast))"}>} Forecast),ID)

expression3:

AGGR(Nodistinct sum({<Date_ForeCast = {"$(=Aggr(NODISTINCT Min(Date_ForeCast),ID))"}>} Forecast),ID)

Application in attachment.

Thank You!

Best regards,

Aleksandrov Anton.

1 Solution

Accepted Solutions
sunny_talwar

This is another option and probably better than using double aggregate:

Sum(TOTAL <ID> AGGR(IF(Date_ForeCast = Min(TOTAL <ID> Date_ForeCast), Sum(Forecast)),Date_ForeCast,ID))


Capture.PNG

View solution in original post

3 Replies
sunny_talwar

This is another option and probably better than using double aggregate:

Sum(TOTAL <ID> AGGR(IF(Date_ForeCast = Min(TOTAL <ID> Date_ForeCast), Sum(Forecast)),Date_ForeCast,ID))


Capture.PNG

asgardd2
Creator III
Creator III
Author

Thank you for your reply!

sunny_talwar

No problem at all