9 Replies Latest reply: May 23, 2016 12:24 PM by Sunny Talwar RSS

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

    Dan Gitzler

      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)

        • Re: Why does this string not work?!?!?!
          Ruben Marin

          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'?

            • Re: Why does this string not work?!?!?!
              Dan Gitzler

              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?!?!?!
                  Ruben Marin

                  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.

                    • Re: Why does this string not work?!?!?!
                      Dan Gitzler

                      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.

                        • Re: Why does this string not work?!?!?!
                          Sunny Talwar

                          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?

                            • Re: Why does this string not work?!?!?!
                              Dan Gitzler

                              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)

                                • Re: Why does this string not work?!?!?!
                                  Sunny Talwar

                                  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)

                      • Re: Why does this string not work?!?!?!
                        Sunny Talwar

                        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)