Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am new to Qlik, but I have scoured the interweb on this one and cannot find an answer. I have an app where I want to format the values as either money or a number based on the selection of the user. I am using various variables and also have a variable input item used to switch between Sales and Items (hence the need to switch formats). The issue I am running into is that I want to use the selection of the user in that variable input to decide what format to start with, then use the value to determine whether I display converted to 'K' or 'M'.
I have put my calculation below, but what happens when I uncomment the part of the If statement that uses the metric value is that I get an 'OK' from the script validation tool, but a return of 0 results. It does not seem to want to use my variable without some sort of aggregation.
Any help here would be much appreciated!
if(
// $(=vMetricType)=Sales and
sum({<InvoiceDate = {">=$(vCurrentYear_FirstDate) <=$(vCurrentDate_MaxDate)"}>}$(vMetricType))>=1000000,
NUM(sum({<InvoiceDate = {">=$(vCurrentYear_FirstDate) <=$(vCurrentDate_MaxDate)"}>}$(vMetricType))/1000000,'$#,##0.##M;-$#,##0.##M'),
NUM(sum({<InvoiceDate = {">=$(vCurrentYear_FirstDate) <=$(vCurrentDate_MaxDate)"}>}$(vMetricType))/1000,'$#,##0.##K;-$#,##0.##K'))
Hi, maybe it's because you need to add simple quotes: '$(=vMetricType)'='Sales'
Hi, maybe it's because you need to add simple quotes: '$(=vMetricType)'='Sales'
That did it! Thank you!