Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to create two things together to read the data correctly from the DB, what I'm trying to do is to create a KPI using this code to:
1- Convertolocaltime
2- count distinct id's
Count({<num(converttolocaltime(DateNum,'Eastern Time (US & Canada)'))={">=$(=Num(YearStart(Max(DateNum))))<=$(=(Max(DateNum)))"},Date=,[Month]=,[Year], [YearMonth]=,[Week]=,[Quarter]=, active = {'1'},archived={'0'}>} distinct id)
Anyhelp?
Hi!
This is not how set expression works:
num(converttolocaltime(DateNum,'Eastern Time (US & Canada)'))={">=$(=Num(YearStart(Max(DateNum))))<=$(=(Max(DateNum)))"}
Please check for more info: https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/ChartFunctions/Se...
Remember, inside set expression is Field = {value or expression}, not expression = {Expression}.
To solve this problem you should create a Field with ConvertLocal and then use that field as part of your set expression:
Count({<[ConvertedLocal_DateNum]={">=$(=Num(YearStart(Max(DateNum))))<=$(=(Max(DateNum)))"} ,Date=,[Month]=,[Year], [YearMonth]=,[Week]=,[Quarter]=, active = {'1'},archived={'0'}>} distinct id)
Please note use Floor and not Num when convert to Local time, unless you are interested in hours and not dates.
Example script I worked on:
Hi!
This is not how set expression works:
num(converttolocaltime(DateNum,'Eastern Time (US & Canada)'))={">=$(=Num(YearStart(Max(DateNum))))<=$(=(Max(DateNum)))"}
Please check for more info: https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/ChartFunctions/Se...
Remember, inside set expression is Field = {value or expression}, not expression = {Expression}.
To solve this problem you should create a Field with ConvertLocal and then use that field as part of your set expression:
Count({<[ConvertedLocal_DateNum]={">=$(=Num(YearStart(Max(DateNum))))<=$(=(Max(DateNum)))"} ,Date=,[Month]=,[Year], [YearMonth]=,[Week]=,[Quarter]=, active = {'1'},archived={'0'}>} distinct id)
Please note use Floor and not Num when convert to Local time, unless you are interested in hours and not dates.
Example script I worked on: