
Re: Modulo chart function (Qlik Sense 3.2)
William Christensen Apr 5, 2018 10:13 AM (in response to William Christensen)Below is an example that also doesn't work but doesn't rely on any specific data.
=mod(Interval(Now(1)Today(), 'mm'),60)

Re: Modulo chart function (Qlik Sense 3.2)
Sunny Talwar Apr 5, 2018 10:24 AM (in response to William Christensen)May be this
=Interval(frac(Now(1)Today()+1), 'mm')

Re: Modulo chart function (Qlik Sense 3.2)
Marcus Sommer Apr 5, 2018 10:33 AM (in response to William Christensen)The reason because mod() didn't work is that the function accepts only integers as parameter. Beside this I doubt that mod() will return what do you want. Therefore go just with the suggestion from Sunny or calculate your wished output directly maybe with something like:
floor((Now(2)Packing_DtTm) / 24 / 60)
 Marcus

Re: Modulo chart function (Qlik Sense 3.2)
William Christensen Apr 5, 2018 11:04 AM (in response to Marcus Sommer )Your solution is great! However I am struggling to understand why I can't get mod to work.
You were total right about mod needing integers and the interval function returns a dual. With some tweaking I was able to get it to work as I originally expected.
So my original formula can be modified as follows to works as expected but is far less elegant!
=mod(Num#(Text(Interval(Now(1)Today(), 'mm'))), 60)
Great learning lesson! Thanks

Re: Modulo chart function (Qlik Sense 3.2)
Sunny Talwar Apr 5, 2018 11:15 AM (in response to William Christensen)Are the two expressions really equal?
mod(Num#(Text(Interval(Now(1)Today(), 'mm'))), 60)
Interval(frac(Now(1)Today()+1), 'mm')
1st one is telling me that it has been 12 minutes into the hour, but the second one is saying that it has been 672 minutes into the day... what exactly are you trying to calculate? It seemed as if you wanted to calculate minutes into the day.... but this might have been about modulo... but either ways... there might be multiple other ways to handle this... but even before going into modulo... think about the fact that hours and minutes are really fractions and modulo with 1440 might not really be the right way to go... unless you use Num#() function... like you did...

Re: Modulo chart function (Qlik Sense 3.2)
William Christensen Apr 5, 2018 11:26 AM (in response to Sunny Talwar )As you might have guessed my real application is a bit different than the question but I was really trying to understand the syntax. Good catch on my typo. It was supposed to be 1440.
=mod(Num#(Text(Interval(Now(1)Today(), 'mm'))), 1440)
=Interval(frac(Now(1)Today()+1), 'mm')
=Minute(Time(Now(1)))+(Hour(Time(Now(1)))*60)



