Qlik Community

Qlik Sense Data Connectivity

Discussion board where members can learn more about Qlik Sense Data Connectivity.

Not applicable

Why does this string not work?!?!?!

Product_Type__c-={'LearningSpace Enterprise', 'LearningSpace Pro', 'Replay', 'Replay One', 'METIVision', 'N/A', 'LearningSpace One', 'LearningSpace', 'UltraPortable Replay', 'Replay Connect + Replay One', 'LearningSpace Go', 'LearningSpace One VHA', 'Meti-FX', 'LS Connect + LS One'}>}Status)

9 Replies

Re: Why does this string not work?!?!?!

Hi Dan, did you tried? Syntax checker will mark as an error after the '-=' but it works.

Also, the field name has a double underscore ( _ ) between 'Type' and 'c'?

MVP
MVP

Re: Why does this string not work?!?!?!

May be you need a function to begin with?

Concat({<Product_Type__c-={'LearningSpace Enterprise', 'LearningSpace Pro', 'Replay', 'Replay One', 'METIVision', 'N/A', 'LearningSpace One', 'LearningSpace', 'UltraPortable Replay', 'Replay Connect + Replay One', 'LearningSpace Go', 'LearningSpace One VHA', 'Meti-FX', 'LS Connect + LS One'}>}Status)

Not applicable

Re: Why does this string not work?!?!?!

The double underscore is correct, and the code checks OK but it does not actually perform the request, anything after the first product type does not effect the calculation, and i have verified that that product types contain data.

Re: Why does this string not work?!?!?!

Hi Dan, not sure, I don't see any problem in the string. I did something similar with a larger string and worked... maybe in the rest of the expression?

Note that you're doing a '-=', so it have to count all types except the ones you are writing.

Not applicable

Re: Why does this string not work?!?!?!

it does not like that either

Not applicable

Re: Why does this string not work?!?!?!

Count({$<Region__c={'United States'},createdquarter={'4/1/2016'},Return_Visit__c={'yes'},

Product_Type__c-={'LearningSpace Enterprise', 'LearningSpace Pro', 'Replay', 'Replay One', 'METIVision', 'N/A', 'LearningSpace One', 'LearningSpace', 'UltraPortable Replay', 'Replay Connect + Replay One', 'LearningSpace Go', 'LearningSpace One VHA', 'Meti-FX', 'LS Connect + LS One'}>}Status)

I am trying to count everything except these products, so the -= is correct, it will disregard the first product in the string just not the following ones.

Highlighted
MVP
MVP

Re: Why does this string not work?!?!?!

Have tried adding Product_Type__c as dimension and you happen to see all other Product_Type__c which you have tried to exclude?

Would you be able to share a sample?

Not applicable

Re: Why does this string not work?!?!?!

I was able to get the code to work but not by modifying code, I ran both halves of the expression individually then joined them and it worked. The expression is the same except one variable in the first half, i am basically counting with and with out the variable and then dividing to get  a percentage.

Count({$<Region__c={'United States'},createdquarter={'4/1/2016'},Return_Visit__c={yes},

Product_Type__c-={'LearningSpace Enterprise', 'LearningSpace Pro', 'Replay', 'Replay One', 'METIVision', 'N/A', 'LearningSpace One', 'LearningSpace', 'UltraPortable Replay', 'Replay Connect + Replay One', 'LearningSpace Go', 'LearningSpace One VHA', 'Meti-FX', 'LS Connect + LS One'}>}Status)

/

Count({$<Region__c={'United States'},createdquarter={'4/1/2016'},

Product_Type__c-={'LearningSpace Enterprise', 'LearningSpace Pro', 'Replay', 'Replay One', 'METIVision', 'N/A', 'LearningSpace One', 'LearningSpace', 'UltraPortable Replay', 'Replay Connect + Replay One', 'LearningSpace Go', 'LearningSpace One VHA', 'Meti-FX', 'LS Connect + LS One'}>}Status)

MVP
MVP

Re: Why does this string not work?!?!?!

I think you should create a flag in the script and then use that in your set analysis statement

LOAD Product_Type__c,

          If(Match(Product_Type__c, 'LearningSpace Enterprise', 'LearningSpace Pro', 'Replay', 'Replay One', 'METIVision', 'N/A', 'LearningSpace One', 'LearningSpace', 'UltraPortable Replay', 'Replay Connect + Replay One', 'LearningSpace Go', 'LearningSpace One VHA', 'Meti-FX', 'LS Connect + LS One'), 0, 1) as Flag

          ....

FROM Source;

Count({$<Region__c={'United States'}, createdquarter={'4/1/2016'}, Return_Visit__c={yes}, Flag = {1}>}Status)

/

Count({$<Region__c={'United States'}, createdquarter={'4/1/2016'}, Flag = {1}>}Status)