8 Replies Latest reply: Aug 16, 2017 4:17 AM by Prashanth Reddy

# Num and Date and string Format in qliksense

Hi all,

in the straight table i have given the expression as below

=if(Metrics='Amount', sum({<[Primary Comparison Date]={'\$(vMin)'}>}Amount),

if(Metrics='Description',only({<[Primary Comparison Date]={'\$(vMin)'}>}Description),

if(Metrics='Modify Date',Date(only({<[Primary Comparison Date]={'\$(vMin)'}>}[Modify date]),'MM/DD/YYYY'),

)))

i want to display the amount in the num format where if the amount has negative value it have show in the brackests (), how to achive this in the if loop

• ###### Re: Num and Date and string Format in qliksense

Try,

=if(Metrics='Amount',

if(sum({<[Primary Comparison Date]={'\$(vMin)'}>}Amount)<0,

'(' & sum({<[Primary Comparison Date]={'\$(vMin)'}>}Amount & ')',

sum({<[Primary Comparison Date]={'\$(vMin)'}>}Amount

),

if(Metrics='Description',only({<[Primary Comparison Date]={'\$(vMin)'}>}Description),

if(Metrics='Modify Date',Date(only({<[Primary Comparison Date]={'\$(vMin)'}>}[Modify date]),'MM/DD/YYYY'),

)))

• ###### Re: Num and Date and string Format in qliksense

Thru num format we can't acheive this?

• ###### Re: Num and Date and string Format in qliksense

Through num format we cant add characters as per my knowledge. Num format is there to achieve format flexibility.

• ###### Re: Num and Date and string Format in qliksense

Hi Manoranjan,

Thanks

Arvind Patil

• ###### Re: Num and Date and string Format in qliksense

i given this but this is not working in qliksense the reason is number format is in auto, due to this i can't achive this

suppose if i give money as num format #.##; (#.##) , now i m getting the result for negative in brackets,  but for the date format is giving like number format

how to achieve this in qliksense?

• ###### Re: Num and Date and string Format in qliksense

Ok got it.. Just the -ve amount you need to display in ( ) and there is no need of negative symbol.. ryt?

try below,

=if(Metrics='Amount',

if(sum({<[Primary Comparison Date]={'\$(vMin)'}>}Amount)<0,

'(' & fabs(sum({<[Primary Comparison Date]={'\$(vMin)'}>}Amount)&  ')',

sum({<[Primary Comparison Date]={'\$(vMin)'}>}Amount

),

if(Metrics='Description',only({<[Primary Comparison Date]={'\$(vMin)'}>}Description),

if(Metrics='Modify Date',Date(only({<[Primary Comparison Date]={'\$(vMin)'}>}[Modify date]),'MM/DD/YYYY'),

)))

• ###### Re: Num and Date and string Format in qliksense

Hi,

try this

Num(sum({<[Primary Comparison Date]={'\$(vMin)'}>}Amount),'\$#,##0.00;(\$#,##0.00)')