Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mohitd910
Contributor II

Variables are creating problem while deploying the QlikSense Application

Dear Friends,

I have a variable vMaxDate=Date(Max(Date_Date),'DD/MM/YYYY') = 31/OCT/2016

and this set analysis ;-  sum({$<Date_Date={"$(=vMaxDate)"},Flag={'ATTENDED DOCTOR REVENUE'}>} SELFPAYER_LC - DISCOUNT + PAYER1_LC)

it is working fine when i am working on QlikSense Desktop.

But when i am deploying this app on then Variable is showing 30/Dec/1899

and when i created a new variable there it is showing  correct date but not working in the same set analysis

why ???

gwassenaar

stalwar1

mrkachhiaimp

mto

jagan

8 Replies
vinieme12
Esteemed Contributor II

Re: Variables are creating problem while deploying the QlikSense Application

Add an equal to sign

sum({$<Date_Date={" = $(=vMaxDate)"},

also your variable definition should have the equal sign

example it should be

=DATE(..........)

shraddha_g
Honored Contributor III

Re: Variables are creating problem while deploying the QlikSense  Application

can you share sample?

Re: Variables are creating problem while deploying the QlikSense Application

Use this for variable...

Date(Max(Date#(Date_Date,'DD/MM/YYYY')))

mohitd910
Contributor II

Re: Variables are creating problem while deploying the QlikSense Application

It will show total by this way

mohitd910
Contributor II

Re: Variables are creating problem while deploying the QlikSense Application

when i am using same thing

Date(Max(Date#(Date_Date,'DD/MM/YYYY'))) direct in exp showing correct data. but while using through a variable it showing zero.


vinieme12
Esteemed Contributor II

Re: Variables are creating problem while deploying the QlikSense  Application

what total would you expect with Max(DATE)?? have you tried yet??

MVP
MVP

Re: Variables are creating problem while deploying the QlikSense Application

Try removing the '=' before variable in set expression like:


sum({$<Date_Date={'$(vMaxDate)'},Flag={'ATTENDED DOCTOR REVENUE'}>} SELFPAYER_LC - DISCOUNT + PAYER1_LC)

Re: Variables are creating problem while deploying the QlikSense Application

Mohit,

1) Would you explain where do you create this Variable. I mean by using Variable OverView / Script level

Explanation:

I) If you are using Variable OverView

     Sum({<Date = {'$(vMaxDate)'}>} Outstanding)

For Ref, Ctrl + Alt + V

Then create vMaxDate

And the You need to define this =Date(Max(Date),'DD/MM/YYYY')

II) If Script, You can use this

SET vMaxDate = Date(Max(Date),'DD/MM/YYYY');

Community Browser