Discussion board where members can get started with Qlik Sense.
I am new to QS and am currently struggling with variables.
I have two tables (INVOICED and NEWORDERS) which are not related in any way.
I declare a variable using the INVOICED table where I want to track the latest date:
Let vInvoicedmonth = '=max(Invoiced.date)';
I then want to use this variable in the NEWORDERS table where I want to selected the new orders which fall in the same month as the Invoiced data:
sum(if(inmonth([NewOrd.Date], '$(vInvoicedmonth)',0) = -1, [NewOrd.Margin]))
This doesn't work. I suspect it is because the tables are unrelated. Is there a way of creating a global variable (non-static) that can be used across all tables, regardless of relationship?
Can you share the Sample qvf file ?
May be try this , sum(if(match(Month([NewOrd.Date]),Month($(vInvoicedmonth))), [NewOrd.Margin]))
Try removing the single quotes around the variable dollar expansion in the expression:
sum(if(inmonth([NewOrd.Date], $(vInvoicedmonth),0) = -1, [NewOrd.Margin]))