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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

not able to calculate columnwise with date difference

Not able to calculate column wise along with the datedifference for each row.

I created a flag for calculating the difference of date and it works row wise. Now I need to do the total of all the rows based on the datedifference and calculate the overall sum of the product Brand wise.

start_flag =first 3 months, end_flag = remaining months. Flag condition is written in data model level.

  

BrandProductDec-2015Jan-2016Feb-2016Mar-2016Apr-2016May-2016Date
Brand1P1Actuals716566989616Jan 2016
Brand1P2Actuals444030674356Feb 2016
Brand1P3Actuals131431312317625Mar 2016
Brand1P4Actuals94611111888144April 2016

Based on the date, the flag works like for P1 it calculate the actuals from Jan to May. P2 - Feb to May, P3 - Mar to May (Actuals) so on.

For doing the sum(actuals) along with the date-difference : Product P1 it should be actual values from 65 to 144 - 1497.

P2- sum(actuals) = 1188.

=aggr(((sum({<Flag={'start_flag'}>}Actuals))+(sum({<Flag={'end_flag'}>}Actuals))),Product)


I dont know how to achieve it. Could you please suggest?

3 Replies
sunny_talwar

I am not fully sure I understand the issue here. Would you be able to provide a sample to look at?

Anonymous
Not applicable
Author

It would be better if you share your sample app with small set of data

Not applicable
Author

I couldn't provide the sample app. My issue is I couldnt sum the actuals columnwise with date difference.