Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jadams123
Creator
Creator

Quick question

I am trying to use this code in a text box:

=Sum( {$<YEAR = {$(#=Max(YEAR))}, [Week No]= {$(#=Max([Week No]))}, DT = {'Date'}, CT -= {ITC}, DCCF = {YES}>} $(vMargin))

and its showing me this number: 906086.66789

When I want it to show as: $906,086.66

When I do this:

=Sum( {$<YEAR = {$(#=Max(YEAR))}, [Week No]= {$(#=Max([Week No]))}, DT = {'Date'}, CT -= {ITC}, DCCF = {YES}>} AMOUNT)

Its show me the number as $3,000,000.86 (perfectly)

Thanks,

J

3 Replies
swuehl
MVP
MVP

Try

= Money(

Sum( {$<YEAR = {$(#=Max(YEAR))}, [Week No]= {$(#=Max([Week No]))}, DT = {'Date'}, CT -= {ITC}, DCCF = {YES}>} $(vMargin))

)

and set the money format in the script (at the very beginning, the format codes are defined).

MK9885
Master II
Master II

Maybe this?

num(Sum( {$<YEAR = {$(#=Max(YEAR))}, [Week No]= {$(#=Max([Week No]))}, DT = {'Date'}, CT -= {ITC}, DCCF = {YES}>} $(vMargin))) ,'$#,##0;($#,##0.00)')

its_anandrjs

Try this in any text object

=NUM( Sum( {$<YEAR = {$(#=Max(YEAR))}, [Week No]= {$(#=Max([Week No]))}, DT = {'Date'}, CT -= {ITC}, DCCF = {YES}>} $(vMargin)),'$#,##0.00', '.',',')