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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

Need to show Max date for each week Data

Hi All,

I have a tabular report where I Have Week(that is Actually showing each week's Friday) and Date.

So Date is repeating for each week. I Want to show the data for Max date for each week.

Like below:

I want to show 443 for week 3/31/2017.

I am attaching my App. Could you please help me on this.

Thanks,

Sarif

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this:

max(total <ItemNumber,CstWeekBeginDate> aggr(NODISTINCT

if(GetSelectedCount(DateSel)>0,sum({<DateSel={'$(=$(v1))'}>}OrderQuantityOutstanding),sum(OrderQuantityOutstanding))

,ItemNumber,CstWeekBeginDate,DT))


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this:

max(total <ItemNumber,CstWeekBeginDate> aggr(NODISTINCT

if(GetSelectedCount(DateSel)>0,sum({<DateSel={'$(=$(v1))'}>}OrderQuantityOutstanding),sum(OrderQuantityOutstanding))

,ItemNumber,CstWeekBeginDate,DT))


talk is cheap, supply exceeds demand
sunny_talwar

Another option

FirstSortedValue(TOTAL <DIM_ITEM.ItemNumber, DIM_ITEM.ItemDescription, CstWeekBeginDate>

Aggr(

if(GetSelectedCount(DateSel)>0,sum({<DateSel={'$(=$(v1))'}>}OrderQuantityOutstanding),sum(OrderQuantityOutstanding))

,DIM_ITEM.ItemNumber, DIM_ITEM.ItemDescription, CstWeekBeginDate, DT), -DT)

mhmmd_srf
Creator II
Creator II
Author

Hey Sunny,

It is working. But it is repeating. I want one records  for each.

I need oval shaped circled record. How to do this.

Please help.

Thanks,

Sarif

mhmmd_srf
Creator II
Creator II
Author

Hello Gysbert,

This is working. But I dont want repeating records.

I want one record for each week.

What would be the expression then.

Thanks,

Sarif

sunny_talwar

Try this

If(Max(TOTAL <DIM_ITEM.ItemNumber, DIM_ITEM.ItemDescription, CstWeekBeginDate> DT) = DT,

If(GetSelectedCount(DateSel) > 0, Sum({<DateSel={'$(=$(v1))'}>} OrderQuantityOutstanding), Sum(OrderQuantityOutstanding)))

Capture.PNG

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Then remove the DT dimension. That's making the rows unique.


talk is cheap, supply exceeds demand