Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

pnn44794
Valued Contributor

Error In Set Analysis Expression - Syntax Error? Unable To Determine

Hello:

I'm sure I'm missing something simple in the following expression, but I would appreciate another set of eyes taking a look to see what may be wrong with the following set analysis:

If(Num(Count({<[Service Ordered] *= {'Virtual Server Infrastructure (VSI)', 'VSI ICP2'}, Forecast_Product_Base_C *= {'VSI Bronze Base'}, [Approval Completed Quarter] *= {'2019-Q1'}>}), ([Host Name]), '#,##0'))

The expression editor simply says "Error in expression" and puts a red squiggly line under the last parentheses.  All the parentheses seem to match up.

As always, any and all help is appreciated.  Thanks in advance.

 

Labels (1)
1 Solution

Accepted Solutions

Re: Error In Set Analysis Expression - Syntax Error? Unable To Determine

Try this

Num(Count({<
[Service Ordered] *= {'Virtual Server Infrastructure (VSI)', 'VSI ICP2'},
Forecast_Product_Base_C *= {'VSI Bronze Base'},
[Approval Completed Quarter] *= {'2019-Q1'}>}
[Host Name]), '#,##0')
7 Replies

Re: Error In Set Analysis Expression - Syntax Error? Unable To Determine

Try this

Num(Count({<
[Service Ordered] *= {'Virtual Server Infrastructure (VSI)', 'VSI ICP2'},
Forecast_Product_Base_C *= {'VSI Bronze Base'},
[Approval Completed Quarter] *= {'2019-Q1'}>}
[Host Name]), '#,##0')
pnn44794
Valued Contributor

Re: Error In Set Analysis Expression - Syntax Error? Unable To Determine

Hello Sunny:

Thanks for the quick reply.  I appreciate it.  Yes, you're solution works.  So, would I be right to assume the If isn't needed because I'm being specific about what to count?

What if I need to add additional different criteria?  For example, I have a table with Forecast_Product_Base_C with values of VSI Bronze Base, VSI Silver Base and VSI Gold Base where I want to count each one separately?  I think I would need the If then, right?  All 3 could have Service Ordered values as specified in the set analysis.  Sample output table I'm looking for below.  I had the If in place because I wanted to add one at a time to make sure each worked and simply started with just VSI Bronze and if it worked, I was going to add VSI Silver, etc.

ProductTotal Count
VSI Bronze Base3000
VSI Silver Base4000
VSI Gold Base1000
Highlighted

Re: Error In Set Analysis Expression - Syntax Error? Unable To Determine

If Product is your dimension, you wouldn't need if statement....

pnn44794
Valued Contributor

Re: Error In Set Analysis Expression - Syntax Error? Unable To Determine

Product is the dimension label.  Forecast_Product_Base_C is the actual dimension name for that column.  If I don't need the IF statement, what would the set analysis look like?

Re: Error In Set Analysis Expression - Syntax Error? Unable To Determine

I am not sure I understand your data... would you be able to share some raw data and the output you expect from it in an Excel file?

pnn44794
Valued Contributor

Re: Error In Set Analysis Expression - Syntax Error? Unable To Determine

I'm having a problem with my data model at the moment.  Once I get that fixed, I'll provide some sample data and sample output.  I appreciate your patience.

pnn44794
Valued Contributor

Re: Error In Set Analysis Expression - Syntax Error? Unable To Determine

Hello Sunny:

I'm still having some data problems, but your initial answer was correct and I will mark it as such.  I'll start another thread if needed for my newest problem.  Thank you for your assistance.  It's appreciated.

Community Browser