If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
Hello,
I'm using QlikSens Desktop
I want to create KPI visualisation whith show total SALES for the current month.
I Created a variable currentMonth = Month(today())
currentMonth value = juil.
currentMonthTotalSales = Sum({< [DateCmd_PK-Date_PK.autoCalendar.Month] = {'juil.'}> } Total_HT) ---> WORKS
currentMonthTotalSales = Sum({< [DateCmd_PK-Date_PK.autoCalendar.Month] = {currentMonth}> } Total_HT) DOES NOT WORKS
I also Tried
currentMonthTotalSales = Sum({< [DateCmd_PK-Date_PK.autoCalendar.MonthRelNo] = {6}> } Total_HT) --> this does not work also
could some one help me on this issue please ?
try this
= Sum({< [DateCmd_PK-Date_PK.autoCalendar.Month] = {"$(=MaxString(YourMonthFiled))"}> } Total_HT)
currentMonthTotalSales = Sum({< [DateCmd_PK-Date_PK.autoCalendar.Month] = {${currentMonth}}> } Total_HT)
Does above work?
month() returns a dual value and is likely using the number for comparison, try using monthname()
currentMonth = MonthName(today())
currentMonth = Month(Max(date));
Expression:
currentMonthTotalSales = Sum({< [DateCmd_PK-Date_PK.autoCalendar.Month] = {'$( =$(currentMonth) )'}> } Total_HT)
This will be helpful:
currentMonthTotalSales = Sum({< [DateCmd_PK-Date_PK.autoCalendar.Month] ={$(=currentMonth)}> } Total_HT) //with parentesis...
Or:
currentMonthTotalSales = Sum({< [DateCmd_PK-Date_PK.autoCalendar.Month]={$(=Max( [DateCmd_PK-Date_PK.autoCalendar.Month]))}> } Total_HT)
Or
currentMonthTotalSales = Sum({< [DateCmd_PK-Date_PK.autoCalendar.Month]={$(=Month (today ()))}> } Total_HT)
thank you for all your answers it helped me well.
I think that all your answer where right
I m new to QlikSens and the syntax wasn't pretty easy to understand for retriving local variable for me !!
Special thanks to "Thiago Justen Teixeira"
it's all good !!
Happy to help you, my friend!
If you could, please close this thread by marking one of these answers as correct.
Cheers