Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guys,
I have a percentage that display the variation between the month of year Versus same month of year -1
The problem when the month is current month, the variation is false because it compares 5 days of current month Vs hole month of year -1
here is my expression:
=num((num(sum( {$<[Year of date]={$(=Max([Year of date]))}>} recharge_amount),'# ##0')
-num(sum( {$<[Year of date]={$(=Max([Year of date])-1)}>} recharge_amount),'# ##0'))
/ num(sum( {$<[Year of date]={$(=Max([Year of date])-1)}>} recharge_amount),'# ##0') *100,'# ## % ')
Hi,
again - as i already replied in e-mail twice:
Hi Wieme,
I think your expression should look similar to this:=num((num(sum( {$<[Year of date]={$(=Max([Year of date]))},[YourDateField]={"<$(=Date(Today()))"}>} recharge_amount),'# ##0') // 2017
- num(sum( {$<[Year of date]={$(=Max([Year of date])-1)},[YourDateField]={"<$(=Date(AddYear(Today(),-1))"}>} recharge_amount),'# ##0')) //2016
/ num(sum( {$<[Year of date]={$(=Max([Year of date])-1)},[YourDateField]={"<$(=Date(AddYear(Today(),-1))"}>} recharge_amount),'# ##0') *100,'# ## % ') //2016
As a alternative i would create a flag in datamaodel flagging dates for YTD, where today is Today()-1 - see help document for details:
regards
Lech
Best Regards,
Lech
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.
Can you elaborate your problem a little more Wiem, wasn't really clear what you're expiriencing.
Hi,
again - as i already replied in e-mail twice:
Hi Wieme,
I think your expression should look similar to this:=num((num(sum( {$<[Year of date]={$(=Max([Year of date]))},[YourDateField]={"<$(=Date(Today()))"}>} recharge_amount),'# ##0') // 2017
- num(sum( {$<[Year of date]={$(=Max([Year of date])-1)},[YourDateField]={"<$(=Date(AddYear(Today(),-1))"}>} recharge_amount),'# ##0')) //2016
/ num(sum( {$<[Year of date]={$(=Max([Year of date])-1)},[YourDateField]={"<$(=Date(AddYear(Today(),-1))"}>} recharge_amount),'# ##0') *100,'# ## % ') //2016
As a alternative i would create a flag in datamaodel flagging dates for YTD, where today is Today()-1 - see help document for details:
regards
Lech
Best Regards,
Lech
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.