5 Replies Latest reply: Aug 1, 2018 1:23 PM by Petter Skjolden RSS

    QlikSense Date Variable not working

    Crystle Stamper

      I am trying to create a variable that is a Date pulled from Salesforce.


      I will be using this variable in NPrinting to create a cycle and folder structure for my reports.


      However, I can not get my variable to show up in my QlikSense app. Since it's not showing up there, I'm not sure it will show up correctly in NPrinting either, so I haven't tried that yet. I wanted to make sure it is working in QlikSense first...


      The script logic I'm using seems correct, but it is not giving me any results when I place it in a table or text box.


      Script Variable

      Set vEffectiveDate = 'Max(Date#(Date(Floor(Effective_Date__c))))';


      I have tried using the $ () in the QS app and without, but it still will not work.


      Any help would be greatly appreciated!

        • Re: QlikSense Date Variable not working
          Petter Skjolden

          What do you mean when you say "I can not get my variable to show up in Qlik Sense"? Don't you see the variable at all? It is a text variable and it would be easy to see if it exists at all and what the content is? Or doesn't it calculate to anything?


          The way you have put the expression in the vEffectiveDate you have it as a text string - and it will not calculate anything until you force it to calculate in the QS App in an expression in a chart. That is as it should be.


          However to get it to calculate you might have to use the = sign like this =$(vEffectiveDate)).


          You expression could be this:




          If Effective_Date__c is a real date, if not make sure that it is when you bring it in in a load statement:




              Date(Date#(Effective_Date__c,'MM/DD/YYYY')) AS Effective_Date__c,