Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have one dimension, month, and two measures, sales and ending on hand inventory. Each month has values for sales and ending on hand inventory. is it possible to have the sales measure be filtered to show total sales for June and July and have the ending on hand inventory be filtered to just for July?
hi
yes you can
1. you select June and July from month field
let assume your expression for sales is : sum(Sales) so you'll get the two months results
for inventory you'll use : sum({<month={"$(=max(monnth))"}>}[inventory on hand])
so it'll only consider the last month
Try with the Alternative states in Qlik Sense .
Alternative States in Qlik Sense
Try adding different alternative stated to Filters and their corresponding objects.
Hope this helps !!
Thanks.
Vikky
when i used the expression below for the measure, end_onhand_cost, and selected Months May and June, 2019, the sales sum was the correct two month total but the end_onhand_cost total was 0.
Sum({<Month={"$(=max(Month))"}>}[end_onhand_cost])
thanks very much for your help. here's what my data looks like.
for June, 2019, field Month=Jun 19, field sys_cal_month_id = 197.
for July, 2019, field Month=Jul 19, field sys_cal_month_id = 198.
i selected Jun 19 and Jul 19 for my 2 months. the sum(sales) gives the correct 2 month total.
i changed your expression to Sum({<Month={"$(=max(sys_cal_month_id))"}>}[end_onhand_cost]). it shows the correct "198" for sys_cal_month_id but it still gives 0 for the end_onhand_cost measure.
what am i doing wrong?
thanks.
john