Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Keepchat in expression !

Hi All,

I have a expression and with an error that I can't fix it:

=sum( {$<YEAR = {$(=MAX(YEAR))},PERIOD={KeepChar( Vcurrent,'2')}>} DOLLAR )

Could anybody tell me what's the problem with the keepchar part?

Thanks,

Nima

6 Replies
MayilVahanan

Hi,

     Before use a variable in expression itself, use keepchar function.. and use like this,

    = Sum ({<Year = { $(=Max(Year))} ,Period ={'=$(=vCurrent))'}>} DOLLAR)

     vCurrent = > KeepChar(Year,'2') something like this

    

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

That's the problem!

I have to use keepchar in expression because the Vcurrent changes based on the selection.

I want to re-use the Vcurrent for different columns, like :

PERIOD={KeepChar( Vcurrent,'3')} or

PERIOD={KeepChar( Vcurrent,'4')} and so on.

Any help is appreciated.

Thanks,

Nima

Not applicable
Author

Sorry the Doc is big and upload it

MayilVahanan

HI,

     Try like this,

    

=sum( {$<YEAR = {$(=MAX(YEAR))},

Period= {'=$(=KeepChar(Vcurrent,chr(39) &2 & chr(39)))'}>}Dollar)

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks, but it returns nothing in expression but it text box it's good.

kind of weird !!

MayilVahanan

Hi,

     Check in expression step by step.. You can find the solution..

    

    

=sum( {$<YEAR = {$(=MAX(YEAR))} >}Dollar)

=sum( {$<Period= {'=$(=KeepChar(Vcurrent,chr(39) &2 & chr(39)))'}>}Dollar)

Then combine both..You can find solution.

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.