Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
pnn44794
Partner - Specialist
Partner - Specialist

Don't Quite Have A True Rollup - Need A Little Help, Please

Hello:

I have a straight table where I'm trying to roll up orders into a single row per DM # based on several criteria and it's not quite working.  I need for all DM #'s that meet the following criteria:

If((PROD_KEY3 <> 'VSI-D Clustered' and Len(Trim(PROD_KEY3))>0) and [STATUS_ORIGINAL] <> 'Provisioning' and REQUEST_TYPE Like 'New*' and NET_ASSETS > 0 and Len(Trim(COMPLETED))=0, 1, 0) as Flag <--This is located and executed within the load script

I have the following expressions:

Sum({<Flag = {1}>}[NET_ASSETS]) <--Labeled as Outstanding Units

Date(Min({<Flag = {1}>}[CREATED DATE])) <--I need the oldest CREATED DATE for each particular DM # that meets the If statement above

Date(Max({<Flag = {1}>}[Promise Date])) <--I need the most recent Promise Date for the DM # with the oldest date

Date(Max({<Flag = {1}>}[Trend Date])) <--I need the most recent Trend Date for the DM # with the oldest date

So, if I have DM # 12345 with three different Order ID's with quantities of 5, 10 and 15 respectively, CREATED DATES of 01/05/2018, 02/01/2018 and 03/05/2018, respectively, Promise Dates of 01/20/2018, 02/15/2018 and 03/25/2018, respectively and lastly, Trend Dates of 02/10/2018, 03/25/2018 and 05/01/2018, respectively, I need to return one row with a total Outstanding Units of 30, an Order Date (CREATED DATE) of 01/05/2018 (the oldest date), a Promise Date of 03/25/2018 (most recent) and a Trend Date of 05/01/2018 (most recent) after meeting the above If condition.

Does this make sense?

As always, thanks in advance for any and all responses and help.

27 Replies
pnn44794
Partner - Specialist
Partner - Specialist
Author

I'm not sure that I follow you.  Are you saying that I should not be using it as an expression for Background color?  If not, then where should I use it?  Or, are you saying something completely different?  Sorry, but I'm just not sure.

pnn44794
Partner - Specialist
Partner - Specialist
Author

Never mind.  My bad.  Sorry.  I understand now.  Duh on my part.    Ok.  Will try now.

sunny_talwar

pnn44794
Partner - Specialist
Partner - Specialist
Author

Eureka!!!!!!  Once I added Max({<Flag = {1}>}[CREATED DATE]) as an expression, put it next to Order Date and then had Max([CREATED DATE]) and Min([CREATED DATE]) right after Order Date, I saw it.  Meaning, I knew what needed to be done.  I needed to use Min instead of Max for the Background color expression.  The final Background color expression and then a screenshot showing the results are below.

 

Sunny, as always, thank you for your help and patience.  I appreciate it.  This was a great exercise for me to go through and I learned a lot, especially around troubleshooting.  Thank you again.

 

I'll mark the correct answer unless you have anything else you'd like to add?

 

 

sunny_talwar

I don't see any screenshots

pnn44794
Partner - Specialist
Partner - Specialist
Author

Added.  Got so excited, I forgot to post it.  lol

sunny_talwar

Looks good... next time... I suggest you to break your problem into small piece just like we did above and 5 out of 10 times you will solve your own issue and the other 5 times you will be able to have a much better understanding of what the problem is... which means better explanation of problem here (and may be more focused) and a quick resolution

pnn44794
Partner - Specialist
Partner - Specialist
Author

Test message.