Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to
select
count(id)
where
field 1 like 'Inventory'
or field 2 = 'Inventory'
I need this in a chart expression. I know that I can
field 1 = {*Inventory*},
field 2 = {'Inventory')}
likewise,
field 1 = {*Inventory*},
field 2 +={'Inventory') or -= or /=
I need to make sure that I count field one is inventory or where filed 2 is inventory.
I am quite new to QlikView and any help would be appreciated.
Yes, you missed '<'. try:
count({<wr.Short_Description = {'*Inventory*'}> + <wr.Work_Request_Type = {'Inventory'} >} Work_Request_ID)
Try with this
Count({<Field1={*Inventory*}> + <Field2={'Inventory'}>} FieldName)
I don't know if I understood your question properly but try this expression.
=Count({<Field1 = {'Inventory'}>} ID) + Count({<Field2 = {'Inventory'}>} ID) - Count({<Field1 = {'Inventory'}, Field2 = {'Inventory'}>} ID)
This expression gives you the count of ID, where only one of Filed1 and Field2 is equal to "Inventory"
I haven't tested this but I would try:
Count( { $ < id = { " [Field 1] = 'Inventory' OR [Field 2]='Inventory' " } > } id)
Hope it works.
Minor correction the above expression is a definition of (A union B) = either A or B or (A & B).
If you are looking for only (A or B), use the modified expression:
=Count({<Field1 = {'Inventory'}>} ID) + Count({<Field2 = {'Inventory'}>} ID) - 2*Count({<Field1 = {'Inventory'}, Field2 = {'Inventory'}>} ID)
Hi Robert,
Try this
=Count({<Field1={'*Inventory*'}> + <Field2={'Inventory'}>} FieldName)
Regards,
Jagan.
This looks promising. However, it gives me a syntax error.
I tried this
count({<wr.Short_Description = {'*Inventory*'}> + wr.Work_Request_Type = {'Inventory'} >} Work_Request_ID)
//Count({<Field1={*Inventory*}> + <Field2={'Inventory'}>} FieldName)
I maybe missing something in my syntax.
No syntax error. However, not giving me the field 1 or field 2. I am getting 0 when I should have at least 68 where the field 1 like *Inventory*
I am looking counts where have A or B. I will test this to see the result.
You have missed on angular bracket before wr.Work_Request_Type
count({<wr.Short_Description = {'*Inventory*'}> + <wr.Work_Request_Type = {'Inventory'} >} Work_Request_ID)