Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
neetu_singh
Partner - Creator III
Partner - Creator III

Variable error

Dear All,

Can some one help me on this, i am using a variable for max date but when i call this variable into pivot table its not working & if i used expression which is mention in variable is working fine as vMaxDate =  date(max(CommonDate,'DD/MM/YYYY')). please find the below screen shot this expression is not working into variable & i need this into variable as i have to use this into set expression.

Regards

Neetu Singh

Labels (1)
14 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi Neetu,

I think you have given '=' while declaring variable in front end.  Remove '=' in the variable expression and use

=$(vVariableName) in your expression.

If you give '=' in variable declaration it evaluates expression and stored value in expression.

Hope the following URL help you in understanding this concept.

http://www.quickqlearqool.nl/?p=902

Hope this helps you.

Regards,

Jagan.

neetu_singh
Partner - Creator III
Partner - Creator III
Author

have already tried but not working

jonathandienst
Partner - Champion III
Partner - Champion III

Neetu

The max variable needs to include the username somehow. Without your model I am guessing at fieldnames and structure, but I think you might need something like:

=Date(Max(If (User = OsUser(), CommonDate)), 'DD/MM/YYYY')

If the value in the field User does not include the domain, then use subfield to get the username

=Date(Max(If (User = Subfield(OsUser(), '\', 2), CommonDate)), 'DD/MM/YYYY')

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

Neetu

OSUser() returns the currently logged in user. If you need this in a chart dimension, then adjust the expression accordingly.

I suggest that you get the expression to return the correct results before you put it in a variable.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
neetu_singh
Partner - Creator III
Partner - Creator III
Author

Dear All,

Its done, for this we need to create a ledger by using peak function at the backend then if user have done last entry on 21/04/2012 then from 21 to 30/04/2012 it will give the same value using peak function.

So its resolved.

Thanks for all your support.

Regards

Neetu Singh