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: 
Not applicable

Including Dimensions in Set expression

Hello,

I am looking for Set expression which will consider the last column to calculate the Nr column. In the example below the value

Aus-Oct2016 should be 8. It is being shown as 14 here due to the entries in one of the Fact tables. the SITE_DT column is from a different Fact table and i want the Nr to calculate the days from the Site_DT.

Please let me know if more information is needed.

Nr:

Max({<DT_CONS_DIM.FISC_YR_NBR={"$(=Only({1}YearofToday))"},

DateNum={"<=$(=Num(Max(INV_RPT_TRNS.SITE_DT)))"}>}DT_CONS_DIM.FISC_DAY_OF_MTH_NBR)

 

PeriodCTRY_NAMDrNrDate(Max(INV_RPT_TRNS.SITE_DT))
Oct-16Australia281410/9/2016
Oct-16Canada28810/9/2016
Oct-16Germany281510/16/2016
Oct-16IN281510/16/2016
Oct-16India2814
Oct-16Mexico281510/16/2016
Oct-16Netherlands28810/9/2016
Oct-16UN28810/9/2016
Oct-16US281510/16/2016
Oct-1628
Sep-16Australia35359/25/2016
Sep-16Canada35299/25/2016
Sep-16Germany35349/25/2016
Sep-16IN35299/25/2016
Sep-16India3535
Sep-16Mexico35349/25/2016
Sep-16Netherlands35299/25/2016
Sep-16UN35299/25/2016
Sep-16US35359/25/2016
Sep-1635
Aug-16Canada28228/21/2016
Aug-16Germany28228/21/2016
Aug-16IN28228/21/2016
Aug-16Mexico28228/21/2016
Aug-16UN28228/21/2016
Aug-16US28288/21/2016
Aug-1628

Thanks.

10 Replies
Not applicable
Author

Thanks for your reply Ruben.My bad, let me upload the one with data. But I am using the number format for dates,

=Sum({<DateNum={"<=$(=Num(Max(INV_RPT_TRNS.SITE_DT)))"}>}SLS_RPT_TRNS.COST_USD_AMT)


My requirement is to restrict the Sum(SLS_RPT_TRNS.COST_USD_AMT) to the dates SITE_DT but it is being shown for the entire period now.


For Australia, the value should be 12533601 which is the value from the beginning of Oct2016 till 8th oct, but it being shown as 307899808 which is the value for the entire month of Oct.