Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys,
I have the following current logic which counts certain movement types and displays them in a car chart.
This is working perfectly for me.
count({<MVT={'311','201','312','411'},[Day/Eve]={'Eve','Days'},Numeric={'0','1'}>}MVT)
An issue i am having is within the data certain movement types are being doubled counted so i want to divided these by two. I want to divide the MVT types 311, 312 & 411 by two but having trouble doing so.
Current attempt is below.
if (count({<MVT={'201'},[Day/Eve]={'Eve','Days'},Numeric={'0','1'}>}MVT))*1
if ((count({<MVT={'311','312','411'},[Day/Eve]={'Eve','Days'},Numeric={'0','1'}>}MVT))/2
Not too familiar with expressions within Qlicksense so not sure what i am doing wrong.
Open the presentation tab and click on Suppress Zero-Values
Regards,
Vitalii
Hi,
In Qlik IF function requires at list two parameters (condition, then) also you can add a third parameter (condition, then, else)
if(condition, then)
if(condition, then, else)
If you want just to divide the value in your expression, you can do it without if statement
count({<MVT={'311','312','411'},[Day/Eve]={'Eve','Days'},Numeric={'0','1'}>}MVT)/2
Also maybe it makes sense to use distinct to remove duplicates
count({<MVT={'311','312','411'},[Day/Eve]={'Eve','Days'},Numeric={'0','1'}>}Distinct MVT)
Regards,
Vitalii
Hey,
With the help of your solution I have been able to use the following:
if(match (MVT,'311','312','411')
, count({<MVT={'311','312','411'},[Day/Eve]={'Eve','Days'},Numeric={'0','1'}>} MVT)/2,
if(MVT = '201'
, count({<MVT={'201'},[Day/Eve]={'Eve','Days'},Numeric={'0','1'}>}MVT)))
The solution above is working for me but now it is bring in all MVT types even if the value is 0.
This is causing hundreds of 0 values to flow through.
Is there a way to only to display the ones which hold a value on the bar chart?
Currently flowing through like this:
Would like to display such as this like it did with original query which was being used:
Open the presentation tab and click on Suppress Zero-Values
Regards,
Vitalii
That is working perfectly for me now.
Thanks a mill for all your help